Package net.sourceforge.jnlp.cache
Class DirectoryNode
- java.lang.Object
-
- net.sourceforge.jnlp.cache.DirectoryNode
-
public class DirectoryNode extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description DirectoryNode(java.lang.String name, java.io.File absPathToNode, java.util.ArrayList<DirectoryNode> childNodes, DirectoryNode parent)Create a new instance of DirectoryNode.DirectoryNode(java.lang.String name, java.io.File absPathToNode, DirectoryNode parent)Create a new instance of DirectoryNode.DirectoryNode(java.lang.String name, java.lang.String absPathToNode, DirectoryNode parent)Create a new instance of DirectoryNode.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(DirectoryNode node)Append the given node to the list of child nodes.java.util.ArrayList<DirectoryNode>getChildren()Retrieves the list of child nodes.java.io.FilegetFile()Retrieve the file associated with this node.java.io.FilegetInfoFile()java.lang.StringgetName()Retrieve the name of this node.DirectoryNodegetParent()Retrieve the parent node.booleanisDir()Check if this node is a directory.booleanremoveChild(DirectoryNode node)Removes the node specified.java.lang.StringtoString()
-
-
-
Constructor Detail
-
DirectoryNode
public DirectoryNode(java.lang.String name, java.lang.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(java.lang.String name, java.io.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(java.lang.String name, java.io.File absPathToNode, java.util.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 Detail
-
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 java.lang.String getName()
Retrieve the name of this node.- Returns:
- Name of this node.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getFile
public java.io.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 java.util.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 java.io.File getInfoFile()
-
-