Class ArchivePathTree.OpenArchivePathTree

All Implemented Interfaces:
OpenPathTree, PathTree, Closeable, AutoCloseable
Enclosing class:
ArchivePathTree

protected class ArchivePathTree.OpenArchivePathTree extends OpenContainerPathTree
  • Constructor Details

    • OpenArchivePathTree

      protected OpenArchivePathTree(FileSystem fs)
  • Method Details

    • isArchiveOrigin

      public boolean isArchiveOrigin()
      Description copied from interface: PathTree
      Whether the content of this tree comes from an archive or not.

      This is useful for instance when you want to determine if the resources can be updated in dev mode.

    • getContainerPath

      protected Path getContainerPath()
      Description copied from class: OpenContainerPathTree
      This is the path to the container.

      In the case of a zip archive, it's the path of the archive. In the case of a directory, it's the directory.

      Should only be used for equals/hashCode.

      Specified by:
      getContainerPath in class OpenContainerPathTree
    • getRootPath

      protected Path getRootPath()
      Description copied from class: OpenContainerPathTree
      This is the path to the container.

      In the case of a zip archive, it's the path to the root of the archive (i.e. a ZipPath). In the case of a directory, it's the directory.

      Should be used for any read operation on the container.

      Specified by:
      getRootPath in class OpenContainerPathTree
    • readLock

      protected ReentrantReadWriteLock.ReadLock readLock()
    • writeLock

      protected ReentrantReadWriteLock.WriteLock writeLock()
    • initManifest

      protected void initManifest(Manifest m)
      Overrides:
      initManifest in class PathTreeWithManifest
    • initMultiReleaseMapping

      protected void initMultiReleaseMapping(Map<String,String> mrMapping)
      Overrides:
      initMultiReleaseMapping in class PathTreeWithManifest
    • isOpen

      public boolean isOpen()
    • apply

      protected <T> T apply(String relativePath, Function<PathVisit,T> func, boolean manifestEnabled)
      Overrides:
      apply in class OpenContainerPathTree
    • 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
      Overrides:
      accept in class OpenContainerPathTree
      Parameters:
      relativePath - relative path to consume
      consumer - path consumer
    • walk

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

      public void walkIfContains(String relativePath, PathVisitor visitor)
      Description copied from interface: PathTree
      Walks a subtree of this tree that begins with a passed in relativePath, if the tree contains relativePath. If the tree does not contain relativePath then the method returns without an error.

      This method does not create a new PathTree with the root at relativePath. It simply applies an inclusion filter to this PathTree instance, keeping the same root.

      Specified by:
      walkIfContains in interface PathTree
      Overrides:
      walkIfContains in class OpenContainerPathTree
      Parameters:
      relativePath - relative path from which the walk should begin
      visitor - path visitor
    • 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
      Overrides:
      contains in class OpenContainerPathTree
      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
      Overrides:
      getPath in class OpenContainerPathTree
    • close

      public void close() throws IOException
      Throws:
      IOException
    • getOriginalTree

      public PathTree getOriginalTree()