Class DirectoryNode

java.lang.Object
net.sourceforge.jnlp.cache.DirectoryNode

public class DirectoryNode extends Object
  • Constructor Details

    • DirectoryNode

      public DirectoryNode(String name, String absPathToNode, DirectoryNode parent)
      Create a new instance of DirectoryNode.
      Parameters:
      name - Name representing this node.
      absPathToNode - Absolute path to this node given as a String.
      parent - The parent node.
    • DirectoryNode

      public DirectoryNode(String name, File absPathToNode, DirectoryNode parent)
      Create a new instance of DirectoryNode.
      Parameters:
      name - Name representing this node.
      absPathToNode - Absolute path to this node as a File.
      parent - The parent node.
    • DirectoryNode

      public DirectoryNode(String name, File absPathToNode, ArrayList<DirectoryNode> childNodes, DirectoryNode parent)
      Create a new instance of DirectoryNode.
      Parameters:
      name - Name representing this node.
      absPathToNode - Absolute path to this node given as a File.
      childNodes - List of children nodes.
      parent - The parent node.
  • Method Details

    • addChild

      public void addChild(DirectoryNode node)
      Append the given node to the list of child nodes.
      Parameters:
      node - Node to be appended.
    • removeChild

      public boolean removeChild(DirectoryNode node)
      Removes the node specified.
      Parameters:
      node - Node to be removed from the list of children
      Returns:
      true if this list of children contained the specified element
    • getName

      public String getName()
      Retrieve the name of this node.
      Returns:
      Name of this node.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getFile

      public File getFile()
      Retrieve the file associated with this node.
      Returns:
      File that is associated with this node.
    • getParent

      public DirectoryNode getParent()
      Retrieve the parent node.
      Returns:
      DirectoryNode representing the parent of the current node.
    • getChildren

      public ArrayList<DirectoryNode> getChildren()
      Retrieves the list of child nodes.
      Returns:
      ArrayList of type DirectoryNode containing all the child nodes.
    • isDir

      public boolean isDir()
      Check if this node is a directory.
      Returns:
      True if node is directory.
    • getInfoFile

      public File getInfoFile()