Anyone help me with a formatting issue I have? I have a relative file path that my app uses to copy the file over and save it, such as:
\users\user1\test.pdf
Only problem is if you use %1$s
as your formatter string it will copy this file over as a folder and then save the file in that folder开发者_JAVA技巧, so you end up with the file name as part of the path, such as:
\users\user1\test.pdf\test.pdf
Anyone know the correct format string to get around this?
You should use File objects for handling paths.
File f = new File("test/something");
f.getParent();
f.getName();
etc...
精彩评论