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: | Difficult and non-obvious way to get config files | ||
---|---|---|---|
Product: | platform | Reporter: | _ tboudreau <tboudreau> |
Component: | Filesystems | Assignee: | rmatous <rmatous> |
Status: | RESOLVED DUPLICATE | ||
Severity: | blocker | CC: | jglick, jtulach, ttran |
Priority: | P3 | Keywords: | API, API_REVIEW_FAST, ARCH, USABILITY |
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
_ tboudreau
2006-04-13 20:53:52 UTC
Deprecating Repository is not a good idea; there are circumstances where you need to get the default FileSystem directly, e.g. for listeners. Using FileUtil.getConfigFile("").getFileSystem() is possible but odd. The correct body is return Repository.getDefault().getDefaultFileSystem().findResource(path); or perhaps FileObject fo = Repository.getDefault().getDefaultFileSystem().findResource(path); if (fo != null) { return fo; } else { throw new FileNotFoundException(path); } on the assumption that the file/folder is usually expected to exist and most people will forget to null-check. Some use cases now obsoleted by Lookups.forPath, some not. Filed twice indeed. *** This issue has been marked as a duplicate of 91534 *** |