ultraesb

Failed to delete a file in Windows using Java

我怕爱的太早我们不能终老 提交于 2020-04-12 16:51:36
问题 I have been trying to delete a file in windows operating system using the Java IO file.delete() API. However it fails and returns false. The same code works like a charm in Ubuntu. I have verified that the permissions of the file allows the program to delete it. Also all the input and output stream for the file has been opened as try with resources. try (InputStream in = new FileInputStream(localFile); OutputStream out = new FileOutputStream(destinationFileName)) Using a debugger I have

Failed to delete a file in Windows using Java

送分小仙女□ 提交于 2020-04-12 16:48:31
问题 I have been trying to delete a file in windows operating system using the Java IO file.delete() API. However it fails and returns false. The same code works like a charm in Ubuntu. I have verified that the permissions of the file allows the program to delete it. Also all the input and output stream for the file has been opened as try with resources. try (InputStream in = new FileInputStream(localFile); OutputStream out = new FileOutputStream(destinationFileName)) Using a debugger I have