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.
Repository.getDefault().getDefaultFileSystem().getRoot().getFileObject("/foo") is long and incredibly non-obvious, especially now that there is no concept of a Repository in the UI. For new API users, a simple call would be much more friendly. I suggest the following: public static FileObject FileUtil.getConfigurationFile(String path) { return Repository.getDefault().getDefaultFileSystem().getRoot ().getFileObject("path"); } and if possible, deprecate Repository.
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 ***