public static String convertToFileSystemChar ( String name ) { String erg = "" ; Matcher m = Pattern . compile ( "[a-z0-9 _#&@\\[\\(\\)\\]\\-\\.]" , Pattern . CASE_INSENSITIVE ) . matcher ( name ) ; while ( m . find ( ) ) { erg += name . substring ( m . start ( ) , m . end ( ) ) ; } if ( erg . length ( ) > 200 ) { erg = erg . substring ( 0 , 200 ) ; System . out . println ( "cut filename: " + erg ) ; } return erg ; }
convert filename to clean filename