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: | File System API should not be java.io.File centric | ||
---|---|---|---|
Product: | platform | Reporter: | Alexander Simon <alexvsimon> |
Component: | Filesystems | Assignee: | Vladimir Kvashin <vkvashin> |
Status: | RESOLVED INCOMPLETE | ||
Severity: | normal | CC: | issues, jhavlin, jtulach |
Priority: | P3 | Keywords: | API_REVIEW_FAST |
Version: | 7.2 | ||
Hardware: | PC | ||
OS: | Solaris | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 207435 |
Description
Alexander Simon
2012-01-19 06:53:51 UTC
There is FileObject.addRecursiveListener, FileObject.addFileChangeListener. FileObject.refresh(), FileSystem.refresh(). I don't know how to replace normalizeFile(File). (In reply to comment #1) [VK01] Do you mean FileObject.addRecursiveListener, FileObject.addFileChangeListener. FileObject.refresh(), FileSystem.refresh() are quite the same as correspondent FileUtil methods? (If that's true, then it isn't clear to me, why did they appear in FileUtil; but this probably doesn't matter) [VK02] Even if the functionality are same, I would propose adding them to FileUtil, just to not force developers using files in situations file objects can be used. [VK03] It seems we need an SPI to be able to do normalization. An example of such SPI can be found in org.netbeans.modules.dlight.remote (interface org.netbeans.modules.remote.spi.FileSystemProviderImplementation) the implementation is in org.netbeans.modules.dlight.remote.impl (class org.netbeans.modules.remote.impl.fs.RemoteFileSystemProvider) FileObject.xyz methods are in general the same, but they require the FileObject to already exist. The additional functionality of FileUtil.xyz(File) is that it can apply even to non-existing files. Why the java.io.File methods are there? Around NetBeans 4.0, a feeling that File System API is only/primarily useful for java.io.File access straighten up. Since then more and more functionality primarily working with java.io.File has been incorporated into the APIs. Usually (but not always) with some fallback/options for non-java.io.File implementations. Your effort to make remote fs a first class citizen will likely reverse this unfortunate direction. Re. VK01, VK02. I can stick with current state, but if you want submit patches. VK03: Again, you can submit patch. Btw. fileObject.getAttribute("normalizedFO") would be the simplest SPI... Need a patch. No patch. No fun. |