[jetty-dev] [jira] (JETTY-1513) DirectNIOBuffer does not release the file it is constructed from, consequently one cannot delete the file.
"Warren Goldman (JIRA)" <[email protected]>
| Newsgroups | gmane.comp.java.jetty.general |
|---|---|
| Message-ID | <61083385.75245.1336059242914.JavaMail.j2ee-jira@codehaus01.managed.contegix.com> |
Warren Goldman created JETTY-1513:
-------------------------------------
Summary: DirectNIOBuffer does not release the file it is constructed from, consequently one cannot delete the file.
Key: JETTY-1513
URL: https://jira.codehaus.org/browse/JETTY-1513
Project: Jetty
Issue Type: Bug
Components: NIO
Reporter: Warren Goldman
Path file = Paths.get("C:/Temp/my.test");
DirectNIOBuffer buffer = new DirectNIOBuffer(file.toFile());
Files.deleteIfExists(file);
// the Files.deleteIfExists throws the following exception
// java.nio.file.FileSystemException: C:\Temp\my.test: The process cannot access the file because it is being used by another process.
// at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
// at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
// at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
// at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:268)
// at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:108)
// at java.nio.file.Files.deleteIfExists(Files.java:1110)
// at test.MyTest.run(MyTest.java:28)
// at test.MyTest.main(MyTest.java:41)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email