Package uk.ac.starlink.connect
Class FileBranch
- java.lang.Object
-
- uk.ac.starlink.connect.FileNode
-
- uk.ac.starlink.connect.FileBranch
-
-
Constructor Summary
Constructors Constructor Description FileBranch(java.io.File dir)
Constructs a branch from a File object representing an existing directory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Node
createNode(java.lang.String location)
Attempts to construct a new node in the context of this one.Node[]
getChildren()
Returns the array of child nodes belonging to this branch.boolean
isHidingEnabled()
Indicates whether files marked as hidden by the default FileSystemView are shown or not.void
setHidingEnabled(boolean hiding)
Sets whether files marked as hidden by the default FileSystemView are shown or not.-
Methods inherited from class uk.ac.starlink.connect.FileNode
createNode, equals, getFile, getName, getParent, hashCode, toString
-
-
-
-
Method Detail
-
getChildren
public Node[] getChildren()
Description copied from interface:Branch
Returns the array of child nodes belonging to this branch. All the returned values represent file objects which actuallly exist in the filesystem.- Specified by:
getChildren
in interfaceBranch
- Returns:
- child nodes of this one
-
createNode
public Node createNode(java.lang.String location)
Description copied from interface:Branch
Attempts to construct a new node in the context of this one. The new item may represent a new or an existing node in the filesystem. This call should not in itself perform any write operations on the filesystem (such as creating a node which doesn't currently exist), though a subsequentLeaf.getOutputStream()
call may do so.The returned node will typically be a child of this branch, but need not be, for instance if name is interpreted as an absolute path.
If the named node cannot be created, null may be returned.
- Specified by:
createNode
in interfaceBranch
- Parameters:
location
- name of a node in the context of this branch- Returns:
- node representing the location of an existing or new node
-
isHidingEnabled
public boolean isHidingEnabled()
Indicates whether files marked as hidden by the default FileSystemView are shown or not.- Returns:
- true if hidden files are not shown
-
setHidingEnabled
public void setHidingEnabled(boolean hiding)
Sets whether files marked as hidden by the default FileSystemView are shown or not. The default is true.- Parameters:
hiding
- true to hide hidden files
-
-