Failed to delete a file in Windows using Java
问题 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