|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openide.filesystems.FileSystem
org.openide.filesystems.MultiFileSystem
The base for all filesystems that are build above a top of other ones. This system expects at most one filesystem it should write to and any number of filesystems to read from. If there is more versions of one file than the one from writable filesystem is prefered or the read only systems are scanned in the given order.
Nested Class Summary |
Nested classes inherited from class org.openide.filesystems.FileSystem |
FileSystem.AtomicAction, FileSystem.Environment, FileSystem.HtmlStatus, FileSystem.Status |
Field Summary |
Fields inherited from class org.openide.filesystems.FileSystem |
PROP_DISPLAY_NAME, PROP_HIDDEN, PROP_READ_ONLY, PROP_ROOT, PROP_SYSTEM_NAME, PROP_VALID |
Constructor Summary | |
protected |
MultiFileSystem()
Creates new empty MultiFileSystem. |
|
MultiFileSystem(FileSystem[] fileSystems)
Creates new MultiFileSystem. |
Method Summary | |
void |
addNotify()
Notifies all encapsulated filesystems in advance to superclass behaviour. |
protected Set |
createLocksOn(String name)
When a file is about to be locked this method is consulted to choose which delegates should be locked. |
protected FileSystem |
createWritableOn(String name)
Finds the system to create writable version of the file on. |
protected FileSystem |
createWritableOnForRename(String oldName,
String newName)
Special case of createWritableOn (@see #createWritableOn). |
FileObject |
find(String aPackage,
String name,
String ext)
Finds file in the filesystem by name. |
FileObject |
findResource(String name)
Finds a file given its full resource path. |
protected FileObject |
findResourceOn(FileSystem fs,
String res)
Finds a resource on given filesystem. |
protected FileSystem |
findSystem(FileObject fo)
For given file object finds the filesystem that the object is placed on. |
SystemAction[] |
getActions()
Merge actions from all delegates. |
SystemAction[] |
getActions(Set foSet)
|
protected FileSystem[] |
getDelegates()
All filesystem that this system delegates to. |
String |
getDisplayName()
The name of the filesystem. |
boolean |
getPropagateMasks()
Will mask files that are not used be listed as children? |
FileObject |
getRoot()
Root of the filesystem. |
protected static Enumeration |
hiddenFiles(FileObject folder,
boolean rec)
Finds all hidden files on given filesystem. |
protected void |
hideResource(String res,
boolean hide)
Marks a resource as hidden. |
boolean |
isReadOnly()
This filesystem is readonly if it has not writable system. |
protected void |
markUnimportant(FileObject fo)
Notification that a file has been marked unimportant. |
protected void |
notifyMigration(FileObject fo)
Notification that a file has migrated from one filesystem to another. |
void |
prepareEnvironment(FileSystem.Environment env)
Deprecated. Useless. |
void |
refresh(boolean expected)
Actually implements contract of FileSystem.refresh(). |
void |
removeNotify()
Notifies all encapsulated filesystems in advance to superclass behaviour. |
protected void |
setDelegates(FileSystem[] fileSystems)
Changes the filesystems that this system delegates to |
protected void |
setPropagateMasks(boolean pm)
Set whether unused mask files should be listed as children. |
Methods inherited from class org.openide.filesystems.FileSystem |
addFileChangeListener, addFileStatusListener, addPropertyChangeListener, addVetoableChangeListener, fireFileStatusChanged, firePropertyChange, fireVetoableChange, getCapability, getStatus, getSystemName, isDefault, isHidden, isPersistent, isValid, removeFileChangeListener, removeFileStatusListener, removePropertyChangeListener, removeVetoableChangeListener, runAtomicAction, setCapability, setHidden, setSystemName, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected MultiFileSystem()
public MultiFileSystem(FileSystem[] fileSystems)
fileSystems
- array of filesystems (can contain nulls)Method Detail |
public void refresh(boolean expected)
refresh
in class FileSystem
expected
- should the file events be marked as expected change or not?FileEvent.isExpected()
protected final void setDelegates(FileSystem[] fileSystems)
fileSystems
- array of filesystemsprotected final FileSystem[] getDelegates()
public final boolean getPropagateMasks()
true
if soprotected final void setPropagateMasks(boolean pm)
pm
- true
if sopublic boolean isReadOnly()
isReadOnly
in class FileSystem
public String getDisplayName()
getDisplayName
in class FileSystem
public FileObject getRoot()
getRoot
in class FileSystem
public SystemAction[] getActions()
getActions
in class FileSystem
public SystemAction[] getActions(Set foSet)
getActions
in class FileSystem
public FileObject find(String aPackage, String name, String ext)
FileSystem
The default implementation converts dots in the package name into slashes,
concatenates the strings, adds any extension prefixed by a dot and calls
the findResource
method.
Note: when both of name
and ext
are null
then name and
extension should be ignored and scan should look only for a package.
find
in class FileSystem
aPackage
- package name where each package component is separated by a dotname
- name of the file (without dots) or null
if
one wants to obtain a folder (package) and not a file in itext
- extension of the file (without leading dot) or null
if one needs
a package and not a file
null
if the file does not existpublic FileObject findResource(String name)
FileSystem
findResource
in class FileSystem
name
- the resource path, e.g. "dir/subdir/file.ext" or "dir/subdir" or "dir"
null
if no such file existsprotected final FileSystem findSystem(FileObject fo) throws IllegalArgumentException
fo
- file object
IllegalArgumentException
- if the file object is not represented in this filesystemprotected final void hideResource(String res, boolean hide) throws IOException
res
- resource name of file to hide or showhide
- true if we should hide the file/false otherwise
IOException
- if it is not possibleprotected static Enumeration hiddenFiles(FileObject folder, boolean rec)
folder
- folder to start atrec
- proceed recursivelly
protected FileObject findResourceOn(FileSystem fs, String res)
fs
- the filesystem to scan onres
- the resource name to look for
protected FileSystem createWritableOn(String name) throws IOException
name
- name of the file (full)
IOException
- if the filesystem is readonlyprotected FileSystem createWritableOnForRename(String oldName, String newName) throws IOException
oldName
- original name of the file (full)newName
- name new of the file (full)
IOException
- if the filesystem is readonlyprotected Set createLocksOn(String name) throws IOException
If an delegate resides on a filesystem returned in the resulting set, it will be locked. All others will remain unlocked.
name
- the resource name to lock
IOException
- if the resource cannot be lockedprotected void notifyMigration(FileObject fo)
This method allows subclasses to fire for example FileSystem.PROP_STATUS change to notify that annotation of this file should change.
fo
- file object that change its actual filesystemprotected void markUnimportant(FileObject fo)
fo
- file object that change its actual filesystempublic void prepareEnvironment(FileSystem.Environment env) throws EnvironmentNotSupportedException
prepareEnvironment
in class FileSystem
env
- the environment to setup
EnvironmentNotSupportedException
- if external execution
and compilation cannot be supportedpublic void addNotify()
addNotify
in class FileSystem
public void removeNotify()
removeNotify
in class FileSystem
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |