Interface PathVisit


  • public interface PathVisit
    Provides context for a given path visit
    • Method Detail

      • getRoot

        Path getRoot()
        The root of the path tree the current path belongs to. For a PathTree created for an archive, this will be the path to the archive file. For a PathTree created for a directory, this will be the path to the directory.
        Returns:
        root of the path tree the current path belongs to
      • getPath

        Path getPath()
        The path being visited. The FileSystem the path belongs to will depend on the implementation of the PathTree being visited. For example, for an archive it will be a ZIP FileSystem implementation. The returned path is granted to exist in the underlying file system (unless it was deleted by a parallel process or thread) and therefore it can be used for I/O operations straight away without further resolving, e.g. against getRoot()
        Returns:
        path being visited
      • getUrl

        default URL getUrl()
        URL that can be used to read the content of the path.
        Returns:
        URL that can be used to read the content of the path
      • getRelativePath

        String getRelativePath​(String separator)
        Path relative to the root of the tree as a string with a provided path element separator. For a PathTree created for an archive, the returned path will be relative to the root of the corresponding FileSystem implementation. For a PathTree created for a directory, the returned path will be relative to the directory used as the root of the path tree.
        Parameters:
        separator - path element separator
        Returns:
        path relative to the root of the tree as a string with a provided path element separator
      • stopWalking

        void stopWalking()
        Terminates walking over a PathTree after this visit.