Class LocalDir

java.lang.Object
org.apache.juneau.cp.LocalDir

public class LocalDir extends Object
Identifies a directory located either on the classpath or file system. Used to encapsulate basic resolution and retrieval of files regardless of where they are located.
See Also:
  • Constructor Details

    • LocalDir

      public LocalDir(Class<?> clazz, String clazzPath)
      Constructor for classpath directory.
      Parameters:
      clazz - The class used to retrieve resources.
      clazzPath - The subpath. Can be any of the following:
      • null or an empty string - Package of the class.
      • Absolute path (starts with '/') - Relative to root package.
      • Relative path (does not start with '/') - Relative to class package.
    • LocalDir

      public LocalDir(Path path)
      Constructor for file system directory.
      Parameters:
      path - Filesystem directory location. Must not be null.
  • Method Details

    • resolve

      public LocalFile resolve(String path)
      Resolves the specified path.
      Parameters:
      path - The path to the file to resolve.
      Must be a non-null relative path.
      Does no cleanup of the path (e.g. checking for security holes or malformed values).
      Returns:
      The file if it exists, or null if it does not.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object