java.io.Serializablepublic class Repository
extends java.lang.Object
implements java.io.Serializable
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.| Modifier and Type | Class | Description |
|---|---|---|
static class |
Repository.LayerProvider |
Contributes to content of
system file system
(which influences structure under FileUtil.getConfigRoot()). |
static class |
Repository.LocalProvider |
Provides local repositories, depending on the current execution environment.
|
| Constructor | Description |
|---|---|
Repository(FileSystem def) |
Creates new instance of filesystem pool and
registers it as the default one.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addFileChangeListener(FileChangeListener fcl) |
Deprecated.
useless because there is no filesystem but only
default filesystem in Repository. Add new listener directly to
default filesystem
getDefaultFileSystem(). |
void |
addFileSystem(FileSystem fs) |
Deprecated.
Please use the ClassPath API instead.
|
void |
addRepositoryListener(RepositoryListener list) |
Deprecated.
Please use the ClassPath API instead.
|
java.util.Enumeration<? extends FileSystem> |
fileSystems() |
Deprecated.
Please use the ClassPath API instead.
|
FileObject |
find(java.lang.String aPackage,
java.lang.String name,
java.lang.String ext) |
Deprecated.
Please use the ClassPath API instead.
|
java.util.Enumeration<? extends FileObject> |
findAll(java.lang.String aPackage,
java.lang.String name,
java.lang.String ext) |
Deprecated.
Please use the ClassPath API instead.
|
java.util.Enumeration<? extends FileObject> |
findAllResources(java.lang.String name) |
Deprecated.
Please use the ClassPath API instead.
|
FileSystem |
findFileSystem(java.lang.String systemName) |
Deprecated.
Please use the ClassPath API instead.
|
protected java.util.List<? extends java.net.URL> |
findLayers(Repository.LayerProvider p) |
Allows subclasses registered as
getDefault() to
find out list of URLs for a given provider. |
FileObject |
findResource(java.lang.String name) |
Deprecated.
Please use the ClassPath API instead.
|
static Repository |
getDefault() |
Access method to get default instance of repository in the system.
|
FileSystem |
getDefaultFileSystem() |
Deprecated.
Please use
FileUtil.getConfigFile(String) or
FileUtil.getConfigRoot() instead. |
java.util.Enumeration<? extends FileSystem> |
getFileSystems() |
Deprecated.
Please use the ClassPath API instead.
|
protected static void |
provideLayers(java.lang.ClassLoader l,
java.util.List<java.net.URL> layerUrls) |
Allows subclasses to accept layer contributions from
Repository.LayerProviders. |
void |
readExternal(java.io.ObjectInput ois) |
Deprecated.
Unused.
|
protected void |
refreshAdditionalLayers() |
Methods that tells
Repository subclasses to refresh list of
URLs provided by Repository.LayerProviders. |
void |
removeFileChangeListener(FileChangeListener fcl) |
Deprecated.
useless because there is no filesystem but only
default filesystem in Repository. Add new listener directly to
default filesystem
getDefaultFileSystem(). |
void |
removeFileSystem(FileSystem fs) |
Deprecated.
Please use the ClassPath API instead.
|
void |
removeRepositoryListener(RepositoryListener list) |
Deprecated.
Please use the ClassPath API instead.
|
void |
reorder(int[] perm) |
Deprecated.
Please use the ClassPath API instead.
|
FileSystem[] |
toArray() |
Deprecated.
Please use the ClassPath API instead.
|
void |
writeExternal(java.io.ObjectOutput oos) |
Deprecated.
Unused.
|
public Repository(FileSystem def)
def - the default filesystemprotected void refreshAdditionalLayers()
Repository subclasses to refresh list of
URLs provided by Repository.LayerProviders.protected final java.util.List<? extends java.net.URL> findLayers(Repository.LayerProvider p)
getDefault() to
find out list of URLs for a given provider. The method just calls
Repository.LayerProvider.registerLayers(java.util.Collection).p - the provider.protected static final void provideLayers(java.lang.ClassLoader l,
java.util.List<java.net.URL> layerUrls)
throws java.io.IOException
Repository.LayerProviders.
Layer XMLs will be collected from locations specified in manifests accessible by the
passed ClassLoader, including generated layers.
Finally Repository.LayerProviders 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.layerUrls - out: collection which receives the URLs.java.io.IOException - propagated if some I/O error occurs.public static Repository getDefault()
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.
@Deprecated public final FileSystem getDefaultFileSystem()
FileUtil.getConfigFile(String) or
FileUtil.getConfigRoot() instead.@Deprecated public final void addFileSystem(FileSystem fs)
name
(unless all but one are invalid). To be sure, that
filesystem was really added in Repository, then test that FileSystem
is valid.fs - filesystem to add@Deprecated public final void removeFileSystem(FileSystem fs)
fs - filesystem to remove@Deprecated public final void reorder(int[] perm)
FileSystems by given permutation.
For example, if there are three filesystems, new int[] {2, 0, 1} cycles the filesystems forwards.perm - an array of integersjava.lang.IllegalArgumentException - if the array is not a permutation, or is not the same length as the current number of filesystems in the pool@Deprecated public final java.util.Enumeration<? extends FileSystem> getFileSystems()
FileSystem@Deprecated public final java.util.Enumeration<? extends FileSystem> fileSystems()
FileSystem@Deprecated public final FileSystem[] toArray()
@Deprecated public final FileSystem findFileSystem(java.lang.String systemName)
systemName - name of the filesystemnull if there is no such
filesystem@Deprecated
public final void writeExternal(java.io.ObjectOutput oos)
throws java.io.IOException
oos - object output streamjava.io.IOException - if an error occures@Deprecated
public final void readExternal(java.io.ObjectInput ois)
throws java.io.IOException,
java.lang.ClassNotFoundException
ois - object input streamjava.io.IOException - if an error occuresjava.lang.ClassNotFoundException - if read class is not found@Deprecated public final FileObject find(java.lang.String aPackage, java.lang.String name, java.lang.String ext)
find. The first object that is found is returned or null
if none of the filesystems contain such a file.aPackage - package name where each package is separated by a dotname - name of the file (without dots) or null if
one wants to obtain the name of a package and not a file in itext - extension of the file or null if one needs
a package and not a file nameFileObject that represents file with given name or
null if the file does not exist@Deprecated public final FileObject findResource(java.lang.String name)
name - a name of the resourcenull if the resource can not be foundFileSystem.findResource(java.lang.String)@Deprecated public final java.util.Enumeration<? extends FileObject> findAllResources(java.lang.String name)
name - name of the resourceFileObjects@Deprecated public final java.util.Enumeration<? extends FileObject> findAll(java.lang.String aPackage, java.lang.String name, java.lang.String ext)
FileSystem.find(java.lang.String, java.lang.String, java.lang.String).aPackage - package name where each package is separated by a dotname - name of the file (without dots) or null if
one wants to obtain the name of a package and not a file in itext - extension of the file or null if one needs
a package and not a file nameFileObjects@Deprecated public final void addRepositoryListener(RepositoryListener list)
list - the listener@Deprecated public final void removeRepositoryListener(RepositoryListener list)
list - the listener@Deprecated public final void addFileChangeListener(FileChangeListener fcl)
getDefaultFileSystem().fcl - the listener@Deprecated public final void removeFileChangeListener(FileChangeListener fcl)
getDefaultFileSystem().fcl - the listenerBuilt on April 24 2018. | Portions Copyright 1997-2018 Oracle. All rights reserved.