I'm doing a download from java apps running on linux. The following is the code:
public void downloadCopyToFile(String filename, String outFilename) throws IOException {
try {
URL url = new URL(filename);
log.info("downloading file from: "+url.toString());
log.info("export to: "+outFilename);
File outFile = new File(outFilename);
FileUtils.copyURLToFile(url, outFile);
} catch (IOException e) {
throw e;
}
}
The parameters for the method is as follows:
filename = https://192.168.100.100:8443/generalLedger20240629140353.xlsx outFilename = c:\temp\generalLedger20240629140353.xlsx
When I run this in windows, it can save to c:\temp, but when I move it to the server running linux, it gives me error 500 java.nio.file.AccessDeniedException: c:\temp\generalLedger20240629140353.xlsx
I'm not sure whther copyURLToFile actually understands that this must be written to windows, because if I change the outFilename to /temp/generalLedger20240629140353.xlsx it actually writes to the linux file system.
I have been working on this for the last 3 days. Please help.
/C/temp/
on that system. Which I doubt.