Hi
I have a JAVA SE Code which delete a file on the file system
under windows.
I need to get the path and file name separately. Therefore do something like this and I get them:
String path = C:\\a\\b\\file.xml
String newPath= path.substring(lastIndexOf("\\"));
String fileName=path.substring(lastIndexOf("\\"),path.length() );
Question:
How should I change the code , that works on Unix systems too
As You know on linux is the separator not "\" and which issues I should consider to delete safely on file system??
Thanks for your help
I have a JAVA SE Code which delete a file on the file system
under windows.
I need to get the path and file name separately. Therefore do something like this and I get them:
String path = C:\\a\\b\\file.xml
String newPath= path.substring(lastIndexOf("\\"));
String fileName=path.substring(lastIndexOf("\\"),path.length() );
Question:
How should I change the code , that works on Unix systems too
As You know on linux is the separator not "\" and which issues I should consider to delete safely on file system??
Thanks for your help