Class ClassPathNode

java.lang.Object
net.officefloor.web.resource.classpath.ClassPathNode

public class ClassPathNode extends Object
Node on the class path that may be retrieved as a HttpResource.
Author:
Daniel Sagenschneider
  • Constructor Details

    • ClassPathNode

      public ClassPathNode(String nodePath, String resourcePath, 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 Details

    • createClassPathResourceTree

      public static ClassPathNode createClassPathResourceTree(String classpathPrefix)
      Creates the ClassPathNode tree for available HttpResource 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 String getNodePath()
      Obtains the path of this ClassPathNode from its parent.
      Returns:
      Path of this ClassPathNode from its parent.
    • getResourcePath

      public String getResourcePath()
      Obtains the HttpResource path.
      Returns:
      HttpResource path.
    • getClassPath

      public String getClassPath()
      Obtains the class path for this HttpResource.
      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 child ClassPathNode instances.
      Returns:
      Child ClassPathNode instances.
    • getChild

      public ClassPathNode getChild(String childNodePath)
      Obtains the child ClassPathNode by the name.
      Parameters:
      childNodePath - Child node path.
      Returns:
      Child ClassPathNode or null if no child by node path.