Class ClassPathNode
- java.lang.Object
-
- net.officefloor.web.resource.classpath.ClassPathNode
-
public class ClassPathNode extends java.lang.Object
Node on the class path that may be retrieved as aHttpResource
.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description ClassPathNode(java.lang.String nodePath, java.lang.String resourcePath, java.lang.String classPath, boolean isDirectory)
Initiate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ClassPathNode
createClassPathResourceTree(java.lang.String classpathPrefix)
Creates theClassPathNode
tree for availableHttpResource
instances.ClassPathNode
getChild(java.lang.String childNodePath)
Obtains the childClassPathNode
by the name.ClassPathNode[]
getChildren()
Obtains the childClassPathNode
instances.java.lang.String
getClassPath()
Obtains the class path for thisHttpResource
.java.lang.String
getNodePath()
Obtains the path of thisClassPathNode
from its parent.java.lang.String
getResourcePath()
Obtains theHttpResource
path.boolean
isDirectory()
Indicates if this is a directory.
-
-
-
Constructor Detail
-
ClassPathNode
public ClassPathNode(java.lang.String nodePath, java.lang.String resourcePath, java.lang.String classPath, boolean isDirectory)
Initiate.- Parameters:
nodePath
- Path of this node relative to its parent.resourcePath
-HttpResource
path to this node.classPath
- Class path to this node.isDirectory
-true
if this node is a directory (otherwise a file).
-
-
Method Detail
-
createClassPathResourceTree
public static ClassPathNode createClassPathResourceTree(java.lang.String classpathPrefix)
Creates theClassPathNode
tree for availableHttpResource
instances.- Parameters:
classpathPrefix
- The prefix on the class path to locate resources for the tree.null
for the entire class path.- Returns:
ClassPathNode
.
-
getNodePath
public java.lang.String getNodePath()
Obtains the path of thisClassPathNode
from its parent.- Returns:
- Path of this
ClassPathNode
from its parent.
-
getResourcePath
public java.lang.String getResourcePath()
Obtains theHttpResource
path.- Returns:
HttpResource
path.
-
getClassPath
public java.lang.String getClassPath()
Obtains the class path for thisHttpResource
.- Returns:
- Class path.
-
isDirectory
public boolean isDirectory()
Indicates if this is a directory.- Returns:
true
if this is a directory.
-
getChildren
public ClassPathNode[] getChildren()
Obtains the childClassPathNode
instances.- Returns:
- Child
ClassPathNode
instances.
-
getChild
public ClassPathNode getChild(java.lang.String childNodePath)
Obtains the childClassPathNode
by the name.- Parameters:
childNodePath
- Child node path.- Returns:
- Child
ClassPathNode
ornull
if no child by node path.
-
-