|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mycore.datamodel.ifs2.MCRNode
public abstract class MCRNode
Represents a file, directory or file collection within a file store. Files and directories can be either really stored, or virtually existing as a child node contained within a stored container file like zip or tar.
| Field Summary | |
|---|---|
protected org.apache.commons.vfs.FileObject |
fo
The file object representing this node in the underlying filesystem. |
protected MCRNode |
parent
The parent node owning this file, a directory or container file |
| Constructor Summary | |
|---|---|
protected |
MCRNode(MCRNode parent,
org.apache.commons.vfs.FileObject fo)
Creates a new node representing a child of the given parent |
| Method Summary | |
|---|---|
protected abstract MCRNode |
buildChildNode(org.apache.commons.vfs.FileObject fo)
Creates a node instance for the given FileObject, which represents the child |
MCRNode |
getChild(String name)
Returns the child node with the given filename, or null |
List<MCRNode> |
getChildren()
Returns the children of this node. |
MCRContent |
getContent()
Returns the content of this node for output. |
Date |
getLastModified()
Returns the time this node was last modified, or null if no such time is defined in the underlying filesystem |
String |
getName()
Returns the file or directory name |
MCRNode |
getNodeByPath(String path)
Returns the node with the given relative or absolute path in the file collection this node belongs to. |
int |
getNumChildren()
Returns the number of child nodes of this node. |
MCRNode |
getParent()
Returns the parent node containing this node |
String |
getPath()
Returns the complete path of this node up to the root file collection. |
org.apache.commons.vfs.RandomAccessContent |
getRandomAccessContent()
Returns the content of this node for random access read. |
MCRFileCollection |
getRoot()
Returns the root file collection this node belongs to |
long |
getSize()
For file nodes, returns the file content size in bytes, otherwise returns 0. |
boolean |
hasChildren()
Returns true if this node has child nodes. |
boolean |
isDirectory()
Returns true if this node is a directory |
boolean |
isFile()
Returns true if this node is a file |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.apache.commons.vfs.FileObject fo
protected MCRNode parent
| Constructor Detail |
|---|
protected MCRNode(MCRNode parent,
org.apache.commons.vfs.FileObject fo)
parent - the parent nodefo - the file object representing this node in the underlying
filesystem| Method Detail |
|---|
public String getName()
public String getPath()
throws Exception
Exceptionpublic MCRNode getParent()
public MCRFileCollection getRoot()
public boolean isFile()
throws Exception
Exception
public boolean isDirectory()
throws Exception
Exception
public long getSize()
throws Exception
Exception
public Date getLastModified()
throws Exception
Exception
public boolean hasChildren()
throws Exception
Exception
public int getNumChildren()
throws Exception
Exception
public List<MCRNode> getChildren()
throws Exception
Exception
protected abstract MCRNode buildChildNode(org.apache.commons.vfs.FileObject fo)
throws Exception
fo - the FileObject representing the child in the underlying
filesystem
Exception
public MCRNode getChild(String name)
throws Exception
name - the name of the child node
Exception
public MCRNode getNodeByPath(String path)
throws Exception
path - the absolute or relative path of the node to find, may contain
. or ..
Exception
public MCRContent getContent()
throws Exception
Exception
public org.apache.commons.vfs.RandomAccessContent getRandomAccessContent()
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||