- Java file system repository
- Nested Class Summary
- Constructor Summary
- Method Summary
- Methods inherited from class java.lang.Object
- Constructor Detail
- Repository
- Method Detail
- refreshAdditionalLayers
- findLayers
- provideLayers
- getDefault
- getDefaultFileSystem
- addFileSystem
- removeFileSystem
- reorder
- getFileSystems
- fileSystems
- toArray
- findFileSystem
- writeExternal
- readExternal
- find
- findResource
- findAllResources
- findAll
- addRepositoryListener
- removeRepositoryListener
- addFileChangeListener
- removeFileChangeListener
Java file system repository
Holder for NetBeans default (system, configuration) filesystem, used for most of NetBeans’ runtime configuration. The default implementation is a merge of all of the XML layer files provided by enabled modules, and the config subfolder of the userdir on the user’s disk. If you just want to modify configuration data use e.g.
FileObject menus = FileUtil.getConfigFile("Menu"); // .
Formerly (NB 3.x) contained a list of mounted filesystems. This functionality is no longer used and is now deprecated.
Nested Class Summary
Contributes to content of system file system (which influences structure under FileUtil.getConfigRoot() ).
Constructor Summary
Method Summary
useless because there is no filesystem but only default filesystem in Repository. Add new listener directly to default filesystem Repository.getDefaultFileSystem() .
Allows subclasses registered as Repository.getDefault() to find out list of URLs for a given provider.
Methods that tells Repository subclasses to refresh list of URLs provided by Repository.LayerProvider s.
useless because there is no filesystem but only default filesystem in Repository. Add new listener directly to default filesystem Repository.getDefaultFileSystem() .
Methods inherited from class java.lang.Object
Constructor Detail
Repository
Creates new instance of filesystem pool and registers it as the default one. Also registers the default filesystem.
Method Detail
refreshAdditionalLayers
protected void refreshAdditionalLayers()
Methods that tells Repository subclasses to refresh list of URLs provided by Repository.LayerProvider s.
findLayers
protected final ListURL> findLayers(Repository.LayerProvider p)
Allows subclasses registered as Repository.getDefault() to find out list of URLs for a given provider. The method just calls Repository.LayerProvider.registerLayers(java.util.Collection) .
provideLayers
protected static final void provideLayers(ClassLoader l, ListURL> layerUrls) throws IOException
Allows subclasses to accept layer contributions from Repository.LayerProvider s. Layer XMLs will be collected from locations specified in manifests accessible by the passed ClassLoader, including generated layers. Finally Repository.LayerProvider s will be consulted to append their URLs to the list. If the passed classloader is null , the classloader which loaded the Repository class will be used.
getDefault
Access method to get default instance of repository in the system. The instance is either taken as a result of org.openide.util.Lookup.getDefault ().lookup (Repository.class) or (if the lookup query returns null) a default instance is created. In a contextual environment, the method remembers the result of the default Lookup query, and will return the same instance as a system-wide Repository instance. Instances provided by Lookup.getDefault().lookup(Repository.class) may vary depending on the Lookup’s implementation and context — be aware that multiple Repository instances may exist, possibly one for each contextual Lookup craeted.
getDefaultFileSystem
@Deprecated public final FileSystem getDefaultFileSystem()
addFileSystem
@Deprecated public final void addFileSystem(FileSystem fs)
Adds new filesystem to the pool. Note that a filesystem cannot be assigned to more than one file system pool at one time (though currently there is only one pool anyway). At any given time, no two filesystems in the pool may share the same name (unless all but one are invalid ). To be sure, that filesystem was really added in Repository, then test that FileSystem is valid.
removeFileSystem
@Deprecated public final void removeFileSystem(FileSystem fs)
reorder
@Deprecated public final void reorder(int[] perm)
Reorders FileSystem s by given permutation. For example, if there are three filesystems, new int[] cycles the filesystems forwards.
getFileSystems
@Deprecated public final EnumerationFileSystem> getFileSystems()
fileSystems
@Deprecated public final EnumerationFileSystem> fileSystems()
toArray
@Deprecated public final FileSystem[] toArray()
findFileSystem
@Deprecated public final FileSystem findFileSystem(String systemName)
writeExternal
@Deprecated public final void writeExternal(ObjectOutput oos) throws IOException
Saves pool to stream by saving all filesystems. The default (system) filesystem, or any persistent filesystems, are skipped.
readExternal
@Deprecated public final void readExternal(ObjectInput ois) throws IOException, ClassNotFoundException
Reads object from stream. Reads all filesystems. Persistent and system filesystems are untouched; all others are removed and possibly reread.
find
@Deprecated public final FileObject find(String aPackage, String name, String ext)
Finds file when its name is provided. It scans in the list of filesystems and asks them for the specified file by a call to find . The first object that is found is returned or null if none of the filesystems contain such a file.
findResource
@Deprecated public final FileObject findResource(String name)
findAllResources
@Deprecated public final EnumerationFileObject> findAllResources(String name)
findAll
@Deprecated public final EnumerationFileObject> findAll(String aPackage, String name, String ext)
Finds all files among all filesystems matching a given name, returning all matches. All filesystems are queried with FileSystem.find(java.lang.String, java.lang.String, java.lang.String) .
addRepositoryListener
@Deprecated public final void addRepositoryListener(RepositoryListener list)
removeRepositoryListener
@Deprecated public final void removeRepositoryListener(RepositoryListener list)
addFileChangeListener
@Deprecated public final void addFileChangeListener(FileChangeListener fcl)
Deprecated. useless because there is no filesystem but only default filesystem in Repository. Add new listener directly to default filesystem Repository.getDefaultFileSystem() .
removeFileChangeListener
@Deprecated public final void removeFileChangeListener(FileChangeListener fcl)
Deprecated. useless because there is no filesystem but only default filesystem in Repository. Add new listener directly to default filesystem Repository.getDefaultFileSystem() .