Class FileBranch

  • All Implemented Interfaces:
    Branch, Node

    public class FileBranch
    extends FileNode
    implements Branch
    Branch representing a directory file.
    Since:
    18 Feb 2005
    Author:
    Mark Taylor (Starlink)
    • Constructor Summary

      Constructors 
      Constructor Description
      FileBranch​(java.io.File dir)
      Constructs a branch from a File object representing an existing directory.
    • Constructor Detail

      • FileBranch

        public FileBranch​(java.io.File dir)
        Constructs a branch from a File object representing an existing directory.
        Parameters:
        dir - directory
        Throws:
        java.lang.IllegalArgumentException - if dir is not a directory
    • 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 interface Branch
        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 subsequent Leaf.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 interface Branch
        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