Package uk.ac.starlink.connect
Class FileBranch
java.lang.Object
uk.ac.starlink.connect.FileNode
uk.ac.starlink.connect.FileBranch
Branch representing a directory file.
- Since:
- 18 Feb 2005
- Author:
- Mark Taylor (Starlink)
-
Constructor Summary
ConstructorsConstructorDescriptionFileBranch
(File dir) Constructs a branch from a File object representing an existing directory. -
Method Summary
Modifier and TypeMethodDescriptioncreateNode
(String location) Attempts to construct a new node in the context of this one.Node[]
Returns the array of child nodes belonging to this branch.boolean
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
-
Constructor Details
-
FileBranch
Constructs a branch from a File object representing an existing directory.- Parameters:
dir
- directory- Throws:
IllegalArgumentException
- if dir is not a directory
-
-
Method Details
-
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
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
-