I am currently using an external library function that returns a File object. This works fine for making the file at a default location, but to accommodate concurrent users, I need to have the file be in a specific folder. Without being able to alter the function that makes the file, is there a File function that let’s me specify where it will go to?
I am currently using an external library function that returns a File object. This
Share
You can use the
renameTo(File destination)in theFileAPI to rename the file storing it in another abstract path.ex:
Also note that the API says that this is not always guaranteed to succeed, so you need to check the return value of the method call every time you use this method.