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

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -