java - Name of file with ? at the end -


i have series of files. when see them, terminal, this:

ls filename1^j filename2^j filename3^j filename4^j 

but when open them through finder application this:

finder filename1 filename2 filename3 filename4 

so, make simple java program, based on method below, change name e fix situation:

string newpath = file.getabsolutepath().replace("^j", ""); 

but doesn't fix problem. so, how can rename files?

i solved using simple solution:

filename = filename.replaceall("[^a-za-z0-9.-]", "_"); 

i hope can useful others


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -