I have an issue with the following piece of java code running in Lotus Domino.
File filData = new File(domSapFilePath + "\\DOMSAP" + sdfDateTime.format((Calendar.getInstance()).getTime()) + ".csv");
FileOutputStream foData = new FileOutputStream(filData);
foData.write(DomSapGenerator.GenerateDomSapFile(con, dateFrom, dateTo).getBytes());
foData.close();
con.close();
The created file is in a UNC path but when it tries to write the file, it errors out saying that the file is in use by another process as can be seen below:
error message: java.io.FileNotFoundException: \\10.XX.XX.XX\xxxxxx\XXX\DOXXXXXX22230.csv (The process cannot access the file because it is being used by another process)
I've never programmed in Java before and I was hoping someone could point me in the right direction for a solution for this problem which is happening intermittently.
Thank you.