This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | NIO2 and FileSystems: FileObject to provide java.nio.file.Path | ||
---|---|---|---|
Product: | platform | Reporter: | Jaroslav Tulach <jtulach> |
Component: | Filesystems | Assignee: | Jaroslav Havlin <jhavlin> |
Status: | NEW --- | ||
Severity: | normal | CC: | jglick, sdedic, terje7601, tzezula |
Priority: | P3 | ||
Version: | 7.1 | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | TASK | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 244319 | ||
Attachments: | Test to verify netigso |
Description
Jaroslav Tulach
2011-05-29 21:09:24 UTC
I would say the first priority would be to use the native parts of NIO.2 to improve the functionality and reliability of existing NB code paths: - create a Notifier impl delegating to WatchService - use Files.probeContentType from a low-priority MIMEResolver - define File FileUtil.fromURL(URL) and URL FileUtil.toURL(File), using Path.toUri and Paths.get(URI) on JDK 7 and using File.toURI and new File(URI) plus special UNC handling on JDK 6, and use them throughout the NB code base wherever URL's (or URI's) are being interconverted with File's - define FileUtil methods delegating to Path.resolve/relativize on JDK 7 (and some near-equivalent on JDK 6) and use them in various places, e.g. project.ant - use Files.copy(..., COPY_ATTRIBUTES) for FileObject.copy in masterfs - use Path.normalize/realPath in FileUtil.normalizeFile Created attachment 109169 [details]
Test to verify netigso
(In reply to Jaroslav Tulach from comment #0) > The first goal is to write a bridge to expose any FileObject based solution > via NIO2 path API. http://bits.netbeans.org/8.0/javadoc/org-openide-filesystems/org/openide/filesystems/FileObject.html should either implement http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html or have a method toPath like File has http://docs.oracle.com/javase/7/docs/api/java/io/File.html#toPath() The important question I ask myself is: How will we know our implementation of the Path interface is good enough? My favourite answer: We should have a TCK that works with Path interface (in the openide.filesystems module) and run it (at least) twice: once on Path objects provided by masterfs's FileObjects and once on plain java.io.File.toPath implementation. If they behave the same we can have enough confidence that our Path implementation is compatible enough. |