Reputation: 735
I have some java code that goes ahead and pulls code from a git repository that I have access to. The files are properly pulled locally.
When I try to copy the files with the Files.copy()
method in java.io.file
from one local destination to another, I get the following error thrown:
java.io.FileNotFoundException: C:\Some\Path\dir (Access is denied)
I have already added the following code in attempt to change the file permissions:
fileInitialLocation.setReadable(true, false);
fileInitialLocation.setExecutable(true, false);
fileInitialLocation.setWritable(true, false);
fileFinalLocation.setReadable(true, false);
fileFinalLocation.setExecutable(true, false);
fileFinalLocation.setWritable(true, false);
What can I change to properly copy the files from the initial location to the final location to prevent the access denied error?
Upvotes: 0
Views: 1052