Class HierarchicalContentProxy
- java.lang.Object
-
- ch.systemsx.cisd.openbis.common.io.hierarchical_content.api.HierarchicalContentProxy
-
- All Implemented Interfaces:
IHierarchicalContent
public class HierarchicalContentProxy extends java.lang.Object implements IHierarchicalContent
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addExecuteOnAccessMethod(IHierarchicalContentExecuteOnAccess executeOnAccessMethod)
void
close()
Cleans resources (e.g.boolean
equals(java.lang.Object obj)
IHierarchicalContentNode
getNode(java.lang.String relativePath)
Returns node with specified relativePath starting from root node.static IHierarchicalContent
getProxyFor(IHierarchicalContent hierarchicalContent, java.util.List<IHierarchicalContentExecuteOnAccess> executeOnAccessList)
IHierarchicalContentNode
getRootNode()
Returns root node.int
hashCode()
java.util.List<IHierarchicalContentNode>
listMatchingNodes(java.lang.String relativePathPattern)
Returns list of all file nodes in this hierarchy with relative paths matching given relativePathPattern.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.java.lang.String
toString()
IHierarchicalContentNode
tryGetNode(java.lang.String relativePath)
Returns node with specified relativePath starting from root node, ornull
, if this path does not exist.
-
-
-
Method Detail
-
getProxyFor
public static IHierarchicalContent getProxyFor(IHierarchicalContent hierarchicalContent, java.util.List<IHierarchicalContentExecuteOnAccess> executeOnAccessList)
-
addExecuteOnAccessMethod
public void addExecuteOnAccessMethod(IHierarchicalContentExecuteOnAccess executeOnAccessMethod)
-
getRootNode
public IHierarchicalContentNode getRootNode()
Description copied from interface:IHierarchicalContent
Returns root node.- Specified by:
getRootNode
in interfaceIHierarchicalContent
-
getNode
public IHierarchicalContentNode getNode(java.lang.String relativePath) throws java.lang.IllegalArgumentException
Description copied from interface:IHierarchicalContent
Returns node with specified relativePath starting from root node. If the path isnull
or an empty string then the root node is returned.
- Specified by:
getNode
in interfaceIHierarchicalContent
- Throws:
java.lang.IllegalArgumentException
- if resource with given relativePath doesn't exist under the root of this content.
-
tryGetNode
public IHierarchicalContentNode tryGetNode(java.lang.String relativePath)
Description copied from interface:IHierarchicalContent
Returns node with specified relativePath starting from root node, ornull
, if this path does not exist. If the path isnull
or an empty string then the root node is returned.
- Specified by:
tryGetNode
in interfaceIHierarchicalContent
-
listMatchingNodes
public java.util.List<IHierarchicalContentNode> listMatchingNodes(java.lang.String relativePathPattern)
Description copied from interface:IHierarchicalContent
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
IHierarchicalContent.listMatchingNodes(String, String)
instead with pattern for filename.- Specified by:
listMatchingNodes
in interfaceIHierarchicalContent
-
listMatchingNodes
public java.util.List<IHierarchicalContentNode> listMatchingNodes(java.lang.String startingPath, java.lang.String fileNamePattern)
Description copied from interface:IHierarchicalContent
Returns list of all file nodes in this hierarchy starting from startingPath with file names matching given fileNamePattern.- Specified by:
listMatchingNodes
in interfaceIHierarchicalContent
- Parameters:
startingPath
- Relative path from which the search should start. Use empty string to start in root.
-
close
public void close()
Description copied from interface:IHierarchicalContent
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 ofIHierarchicalContentNode
-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.- Specified by:
close
in interfaceIHierarchicalContent
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-