|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.common.tree.directory.FileSystemView
public class FileSystemView
This interface defines a view of a hierarchy of DirectoryEntry instances.
Constructor Summary | |
---|---|
FileSystemView()
Construct a file system view with a domain of the entire file system, and where the roots represent the root mounts of the file system, such as the drives on a Windows machine or the root directories on a Unix system. |
|
FileSystemView(java.io.File root,
boolean showRoot)
Construct a file system view with a domain of the specified root folder and its contents, and optionally include the specified root as an accessible folder. |
Method Summary | |
---|---|
boolean |
allowsChild(TreeNode parent,
TreeNode potentialChild)
Determine whether the specified parent TreeNode may contain the specified child node. |
boolean |
allowsChildren(TreeNode entry)
Determine whether the specified TreeNode may contain children. |
UserTransaction |
createReadTransaction()
Create a new instance of a UserTransaction that may be used to read information. |
UserTransaction |
createWriteTransaction()
Create a new instance of a UserTransaction that may be used to write and/or update information. |
UserTransaction |
createWriteTransaction(java.lang.Object source)
Create a new instance of a UserTransaction that may be used to write and/or update information. |
void |
entryMoved(java.io.File originalFile,
TreeNode entry)
Update the dirEntries after a node has been moved by the FS Editor |
protected void |
filter(java.util.List entries)
|
java.lang.String |
getAbsolutePath(TreeNode entry)
Obtain the absoluate path for this DirectoryEntry, which includes the path of the root. |
protected java.util.List |
getActualRoots()
Returns all root partitians on this DirectoryEntry system regardless of whether they are hidden. |
protected java.io.File[] |
getChildFiles(TreeNode parent)
Return the array of File instances that are considered the
children of the specified DirectoryEntry. |
java.util.List |
getChildren(TreeNode parent)
Obtain the list of entries that are considered the children of the specified DirectoryEntry. |
java.util.Comparator |
getComparator()
Set the comparator that provides the order for children returned from this view. |
DirectoryEntryEditor |
getDirectoryEntryEditor()
Return the directory entry editor for this view. |
protected java.io.File |
getFile(TreeNode entry)
|
FileSystemEntryEditor |
getFileEntryEditor()
Return the file system editor for this view. |
protected FileSystemEntry |
getFileSystemEntry(java.io.File f,
ObjectDefinition type)
|
TreeNodeFilter |
getFilter()
Set the filter that limits the set of DirectoryEntry instances returned from this view. |
TreeNode |
getHome()
Obtain the DirectoryEntry that represents the folder within this view that represents the single, well-known "bookmarked" folder for this view. |
java.util.Set |
getMarked()
Return the set of marked nodes for this view. |
TreeNode |
getParent(TreeNode entry)
Determine the parent DirectoryEntry for the specified entry, or null if the specified entry is a root. |
java.lang.String |
getPath(TreeNode entry)
Obtain the abstract path for this DirectoryEntry. |
PropertiedObjectEditor |
getPropertiedObjectEditor()
Return the propertied object editor for this view. |
java.util.List |
getPropertyDefinitions()
Get the definitions of the properties for the DirectoryEntry instances returned from this view. |
java.util.List |
getRoots()
Returns all root partitians on this DirectoryEntry system. |
java.lang.String |
getSeparator()
Obtain the character (as a String) that is used to separate names in a path sequence for the abstract path. |
char |
getSeparatorChar()
Obtain the character that is used to separate names in a path sequence for the abstract path. |
TreeNodeEditor |
getTreeNodeEditor()
Return the tree node editor for this view. |
boolean |
isAncestorOf(TreeNode ancestor,
TreeNode descendent)
Determine whether the specified node is a descendent of the given ancestor node. |
boolean |
isHidden(TreeNode entry)
Determine whether the specified DirectoryEntry is hidden. |
boolean |
isMarked(TreeNode entry)
Return the marked state of the specified entry. |
boolean |
isParentOf(TreeNode parent,
TreeNode child)
Determine whether the specified node is a child of the given parent node. |
boolean |
isRoot(TreeNode entry)
Determine whether the specified DirectoryEntry is a root of the underlying system. |
java.util.Iterator |
iterator()
Obtain an iterator for this whole view, which navigates the view's nodes using pre-order rules (i.e., it visits a node before its children). |
java.util.Iterator |
iterator(TreeNode startingPoint)
Obtain an iterator for the view starting at the specified node. |
DirectoryEntry |
lookup(java.lang.String path)
Lookup the node referenced by the relative path in this view. |
DirectoryEntry |
lookup(java.lang.String path,
java.lang.String separator)
Lookup the node referenced by the relative path in this view, but specify a separator. |
void |
setComparator(java.util.Comparator comparator)
Set the comparator that should be used to order the children. |
void |
setFilter(TreeNodeFilter filter)
Set the filter that limits the set of DirectoryEntry instances returned from this view. |
void |
setHome(TreeNode home)
Set the DirectoryEntry that represents the home folder for this view. |
void |
setMarked(TreeNode entry,
boolean markedState)
Set the marked state of the specified entry. |
protected void |
setRoot(java.io.File root,
boolean showRoot)
Set the DirectoryEntryView root to use for the underlying system. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileSystemView()
public FileSystemView(java.io.File root, boolean showRoot)
root
- the folder that is to be the root of this view.showRoot
- boolean flag that if true specifies that the root folder should
be accessible and returned as the single entry from the getRoots
method, or false if the child folders are to be returned as roots of thi
view.Method Detail |
---|
public boolean isMarked(TreeNode entry)
isMarked
in interface TreeView
public void entryMoved(java.io.File originalFile, TreeNode entry)
the
- orignal File for the FileSystemEntrythe
- updated FileSystemEntrypublic void setMarked(TreeNode entry, boolean markedState)
setMarked
in interface TreeView
true
- if the node is to be marked, or false if it is to be un-marked.public java.util.Set getMarked()
getMarked
in interface TreeView
the
- unmodifiable set of marked nodes; never nullpublic void setFilter(TreeNodeFilter filter)
setFilter
in interface TreeView
filter
- the filter, or null if the default "pass-through" filter should be used.public TreeNodeFilter getFilter()
getFilter
in interface TreeView
public void setComparator(java.util.Comparator comparator)
setComparator
in interface TreeView
comparator
- the comparator, or null if entry name sorting should be used.public java.util.Comparator getComparator()
getComparator
in interface TreeView
public java.util.List getPropertyDefinitions()
getPropertyDefinitions
in interface TreeView
public java.util.List getRoots()
getRoots
in interface TreeView
protected java.util.List getActualRoots()
protected void filter(java.util.List entries)
public boolean isRoot(TreeNode entry)
isRoot
in interface TreeView
entry
- the DirectoryEntry instance that is to be checked; may
not be null
public boolean isHidden(TreeNode entry)
isHidden
in interface TreeView
entry
- the DirectoryEntry instance that is to be checked; may
not be null
protected void setRoot(java.io.File root, boolean showRoot)
root
- the File that represents the root.showRoot
- indicates if the root should be displays in the hierarchypublic void setHome(TreeNode home)
home
- the directory entry that represents the home folder; may not be null
and must exist within this view's domain of directory entries.
java.lang.AssertionError
- if home
is null, if the entry does
not represent an existing folder, or if it is not contained within the domain
of this view.public TreeNode getHome()
getHome
in interface TreeView
public java.lang.String getPath(TreeNode entry)
getPath
in interface TreeView
public char getSeparatorChar()
getSeparatorChar
in interface TreeView
public java.lang.String getSeparator()
getSeparator
in interface TreeView
public java.lang.String getAbsolutePath(TreeNode entry)
public TreeNode getParent(TreeNode entry)
getParent
in interface TreeView
entry
- the DirectoryEntry instance for which the parent is to be obtained;
may not be null
public boolean allowsChildren(TreeNode entry)
allowsChildren
in interface TreeView
entry
- the TreeNode instance that is to be checked; may
not be null
public boolean allowsChild(TreeNode parent, TreeNode potentialChild)
allowsChild
in interface TreeView
parent
- the TreeNode instance that is to be the parent;
may not be nullpotentialChild
- the TreeNode instance that is to be the child;
may not be null
public java.util.List getChildren(TreeNode parent)
getChildren
in interface TreeView
parent
- the DirectoryEntry instance for which the child entries
are to be obtained; may not be null
protected java.io.File[] getChildFiles(TreeNode parent)
File
instances that are considered the
children of the specified DirectoryEntry.
parent
- the DirectoryEntry instance for which the child entries
are to be obtained; may not be null
public java.util.Iterator iterator()
iterator
in interface TreeView
public java.util.Iterator iterator(TreeNode startingPoint)
iterator
in interface TreeView
startingPoint
- the root of the subtree over which the iterator
is to navigate; may not be null
public boolean isParentOf(TreeNode parent, TreeNode child)
isParentOf
in interface TreeView
public boolean isAncestorOf(TreeNode ancestor, TreeNode descendent)
isAncestorOf
in interface TreeView
public PropertiedObjectEditor getPropertiedObjectEditor()
getPropertiedObjectEditor
in interface PropertiedObjectView
public TreeNodeEditor getTreeNodeEditor()
getTreeNodeEditor
in interface TreeView
public DirectoryEntryEditor getDirectoryEntryEditor()
getDirectoryEntryEditor
in interface DirectoryEntryView
public FileSystemEntryEditor getFileEntryEditor()
public UserTransaction createReadTransaction()
createReadTransaction
in interface UserTransactionFactory
public UserTransaction createWriteTransaction()
createWriteTransaction
in interface UserTransactionFactory
public UserTransaction createWriteTransaction(java.lang.Object source)
createWriteTransaction
in interface UserTransactionFactory
source
- the object that is considered to be the source of the transaction;
may be null
public DirectoryEntry lookup(java.lang.String path)
This implementation never returns null if the specified path doesn't exist, but in this case the implementation instead returns a FileSystemEntry that will not exist.
lookup
in interface DirectoryEntryView
path
- the path of the desired node specified in terms of this view
(i.e., the result of calling getPath()
on this view with the
returned node as the parameter should result in the same value as path
);
may not be null or zero-length
java.lang.AssertionError
- if the path is null or zero-lengthpublic DirectoryEntry lookup(java.lang.String path, java.lang.String separator)
lookup
in interface DirectoryEntryView
path
- the path of the desired node specified in terms of this view
(i.e., the result of calling getPath()
on this view with the
returned node as the parameter should result in the same value as path
);
may not be null or zero-lengthseparater
- the string used to separate the components of a name.
java.lang.AssertionError
- if the path is null or zero-lengthprotected java.io.File getFile(TreeNode entry)
protected FileSystemEntry getFileSystemEntry(java.io.File f, ObjectDefinition type)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |