Filename rename problem
Hi all,
My problem is sometime i cant rename the filename with my program. For examp
le, before i edit the content of particular file, the filename is file_01.xm
l, then after i edit it and click the save button, i want to rename the file
name to file_01_edited.xml. So, sometime it work but sometime not.
Below is my some coding. Anybody can help me? !0s first.....
String nfilename = tokenString[0] +"_edited";
File original =new File(directoryname +"\\" + "original" + "\\" + tokenStr
ing[0] +".txt");
File noriginal =new File (directoryname +"\\" + "original" + "\\" + nfilen
ame +".txt");
boolean success1 = original.renameTo(noriginal);
File process =new File(directoryname +"\\" + "process" + "\\" + tokenStrin
g[0] +".xml");
File nprocess =new File (directoryname +"\\" + "process" + "\\" + nfilenam
e +".xml");
boolean success2 = process.renameTo(nprocess);
File edit =new File(directoryname +"\\" + "edit" + "\\" + tokenString[0] +
".xml");
File nedit =new File(directoryname +"\\" + "edit" + "\\" + nfilename + ".x
ml");
boolean success3 = edit.renameTo(nedit);

