Interface IHierarchicalContent

  • All Known Implementing Classes:
    HierarchicalContentProxy

    public interface IHierarchicalContent
    Abstraction of a tree-like hierarchical content on the filesystem.
    • Method Detail

      • getNode

        IHierarchicalContentNode getNode​(java.lang.String relativePath)
                                  throws java.lang.IllegalArgumentException
        Returns node with specified relativePath starting from root node. If the path is null or an empty string then the root node is returned.
        Throws:
        java.lang.IllegalArgumentException - if resource with given relativePath doesn't exist under the root of this content.
      • tryGetNode

        IHierarchicalContentNode tryGetNode​(java.lang.String relativePath)
        Returns node with specified relativePath starting from root node, or null, if this path does not exist. If the path is null or an empty string then the root node is returned.
      • listMatchingNodes

        java.util.List<IHierarchicalContentNode> listMatchingNodes​(java.lang.String relativePathPattern)
        Returns list of all file nodes in this hierarchy with relative paths matching given relativePathPattern.

        NOTE: this operation may be expensive for huge hierarchies. If prefix of relative path is constant use listMatchingNodes(String, String) instead with pattern for filename.

      • listMatchingNodes

        java.util.List<IHierarchicalContentNode> listMatchingNodes​(java.lang.String startingPath,
                                                                   java.lang.String fileNamePattern)
        Returns list of all file nodes in this hierarchy starting from startingPath with file names matching given fileNamePattern.
        Parameters:
        startingPath - Relative path from which the search should start. Use empty string to start in root.
      • close

        void close()
        Cleans resources (e.g. releases locks) acquired to access this hierarchical content.

        For now accessing IHierarchicalContentNode from a closed content doesn't fail immediately but it is unpredictable (e.g. files may no longer be accessible). One shouldn't call any methods of IHierarchicalContentNode-s that were acquired from a content which is closed at the time of invocation of the methods. In future version such operations will fail immediately.