Class DirectoryPathTree

java.lang.Object
io.quarkus.paths.PathTreeWithManifest
io.quarkus.paths.DirectoryPathTree
All Implemented Interfaces:
OpenPathTree, PathTree, Closeable, Serializable, AutoCloseable
Direct Known Subclasses:
ArchivePathTree.OpenArchivePathTree

public class DirectoryPathTree extends PathTreeWithManifest implements OpenPathTree, Serializable
See Also:
  • Constructor Details

    • DirectoryPathTree

      public DirectoryPathTree()
      For deserialization
    • DirectoryPathTree

      public DirectoryPathTree(Path dir)
    • DirectoryPathTree

      public DirectoryPathTree(Path dir, PathFilter pathFilter)
    • DirectoryPathTree

      public DirectoryPathTree(Path dir, PathFilter pathFilter, boolean manifestEnabled)
    • DirectoryPathTree

      protected DirectoryPathTree(Path dir, PathFilter pathFilter, PathTreeWithManifest pathTreeWithManifest)
  • Method Details

    • getRoots

      public Collection<Path> getRoots()
      Description copied from interface: PathTree
      The roots of the path tree.
      Specified by:
      getRoots in interface PathTree
      Returns:
      roots of the path tree
    • walk

      public void walk(PathVisitor visitor)
      Description copied from interface: PathTree
      Walks the tree.
      Specified by:
      walk in interface PathTree
      Parameters:
      visitor - path visitor
    • apply

      protected <T> T apply(String relativePath, Function<PathVisit,T> func, boolean manifestEnabled)
      Specified by:
      apply in class PathTreeWithManifest
    • accept

      public void accept(String relativePath, Consumer<PathVisit> consumer)
      Description copied from interface: PathTree
      Consumes a given path relative to the root of the tree. If the path isn't found in the tree, the PathVisit argument passed to the consumer will be null.
      Specified by:
      accept in interface PathTree
      Parameters:
      relativePath - relative path to consume
      consumer - path consumer
    • contains

      public boolean contains(String relativePath)
      Description copied from interface: PathTree
      Checks whether the tree contains a relative path.
      Specified by:
      contains in interface PathTree
      Parameters:
      relativePath - path relative to the root of the tree
      Returns:
      true, in case the tree contains the path, otherwise - false
    • getPath

      public Path getPath(String relativePath)
      Specified by:
      getPath in interface OpenPathTree
    • open

      public OpenPathTree open()
      Description copied from interface: PathTree
      Returns an OpenPathTree for this tree, which is supposed to be closed at the end of processing. It is meant to be an optimization when processing multiple paths of path trees that represent archives. If a path tree does not represent an archive but a directory, for example, this method is expected to be a no-op, returning the original tree as an instance of OpenPathTree.
      Specified by:
      open in interface PathTree
      Returns:
      an instance of OpenPathTree for this path tree
    • isOpen

      public boolean isOpen()
      Specified by:
      isOpen in interface OpenPathTree
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • getOriginalTree

      public PathTree getOriginalTree()
      Specified by:
      getOriginalTree in interface OpenPathTree
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object