|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openide.filesystems.Repository
Holder for system filesystem, used for most of NetBeans' runtime configuration. There is only one useful thing to do with this class:
FileSystem sfs = Repository.getDefault().getDefaultFileSystem(); // now use somehow, e.g. FileObject menus = sfs.findResource("Menu"); // ...Formerly (NB 3.x) contained a list of mounted filesystems. This functionality is no longer used and is now deprecated.
Constructor Summary | |
Repository(FileSystem def)
Creates new instance of filesystem pool and registers it as the default one. |
Method Summary | |
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. |
Enumeration |
fileSystems()
Deprecated. Please use the ClassPath API instead. |
FileObject |
find(String aPackage,
String name,
String ext)
Deprecated. Please use the ClassPath API instead. |
Enumeration |
findAll(String aPackage,
String name,
String ext)
Deprecated. Please use the ClassPath API instead. |
Enumeration |
findAllResources(String name)
Deprecated. Please use the ClassPath API instead. |
FileSystem |
findFileSystem(String systemName)
Deprecated. Please use the ClassPath API instead. |
FileObject |
findResource(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()
Gets the default filesystem of the IDE. |
Enumeration |
getFileSystems()
Deprecated. Please use the ClassPath API instead. |
void |
readExternal(ObjectInput ois)
Deprecated. Unused. |
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(ObjectOutput oos)
Deprecated. Unused. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Repository(FileSystem def)
def
- the default filesystemMethod Detail |
public static Repository getDefault()
org.openide.util.Lookup.getDefault ().lookup (Repository.class)
or (if the lookup query returns null) a default instance is created.
public final FileSystem getDefaultFileSystem()
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 addpublic final void removeFileSystem(FileSystem fs)
fs
- filesystem to removepublic final void reorder(int[] perm)
FileSystem
s by given permutation.
For example, if there are three filesystems, new int[] {2, 0, 1}
cycles the filesystems forwards.
perm
- an array of integers
IllegalArgumentException
- if the array is not a permutation, or is not the same length as the current number of filesystems in the poolpublic final Enumeration getFileSystems()
FileSystem
public final Enumeration fileSystems()
FileSystem
public final FileSystem[] toArray()
public final FileSystem findFileSystem(String systemName)
systemName
- name
of the filesystem
null
if there is no such
filesystempublic final void writeExternal(ObjectOutput oos) throws IOException
oos
- object output stream
IOException
- if an error occurespublic final void readExternal(ObjectInput ois) throws IOException, ClassNotFoundException
ois
- object input stream
IOException
- if an error occures
ClassNotFoundException
- if read class is not foundpublic final FileObject find(String aPackage, String name, 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 name
FileObject
that represents file with given name or
null
if the file does not existpublic final FileObject findResource(String name)
name
- a name of the resource
null
if the resource can not be foundFileSystem.findResource(java.lang.String)
public final Enumeration findAllResources(String name)
name
- name of the resource
FileObject
spublic final Enumeration findAll(String aPackage, String name, 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 name
FileObject
spublic final void addRepositoryListener(RepositoryListener list)
list
- the listenerpublic final void removeRepositoryListener(RepositoryListener list)
list
- the listenerpublic final void addFileChangeListener(FileChangeListener fcl)
getDefaultFileSystem()
.
fcl
- the listenerpublic final void removeFileChangeListener(FileChangeListener fcl)
getDefaultFileSystem()
.
fcl
- the listener
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |