Package org.mycore.datamodel.ifs2
Class MCRDirectory
java.lang.Object
org.mycore.datamodel.ifs2.MCRNode
org.mycore.datamodel.ifs2.MCRStoredNode
org.mycore.datamodel.ifs2.MCRDirectory
- Direct Known Subclasses:
MCRFileCollection
Represents a directory stored in a file collection, which may contain other
files and directories.
- Author:
- Frank Lützenkirchen
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
MCRDirectory
(MCRDirectory parent, String name) Create a new MCRDirectory that does not exist yetprotected
MCRDirectory
(MCRDirectory parent, Path fo, Element data) Create MCRDirectory representing an existing, already stored directory. -
Method Summary
Modifier and TypeMethodDescriptionprotected MCRStoredNode
buildChildNode
(Path fo) Returns the MCRFile or MCRDirectory that is represented by the given FileObject, which is a direct child of the directory FileObject this MCRDirectory is stored in.Creates a new subdirectory within this directorycreateFile
(String name) Creates a new file within this directoryMethods inherited from class org.mycore.datamodel.ifs2.MCRStoredNode
clearLabels, delete, getBasicFileAttributes, getCurrentLabel, getLabel, getLabels, getLocalFile, getLocalPath, readData, renameTo, setLabel, setLastModified, writeData
Methods inherited from class org.mycore.datamodel.ifs2.MCRNode
getChild, getChildren, getContent, getLastModified, getName, getNodeByPath, getNumChildren, getParent, getPath, getRandomAccessContent, getRoot, getSize, hasChildren, isDirectory, isFile
-
Constructor Details
-
MCRDirectory
Create MCRDirectory representing an existing, already stored directory.- Parameters:
parent
- the parent directory of this directoryfo
- the local directory in the store storing this directory
-
MCRDirectory
Create a new MCRDirectory that does not exist yet- Parameters:
parent
- the parent directory of this directoryname
- the name of the new subdirectory to create- Throws:
IOException
-
-
Method Details
-
createDir
Creates a new subdirectory within this directory- Parameters:
name
- the name of the new directory- Throws:
IOException
-
createFile
Creates a new file within this directory- Parameters:
name
- the name of the new file- Throws:
IOException
-
buildChildNode
Returns the MCRFile or MCRDirectory that is represented by the given FileObject, which is a direct child of the directory FileObject this MCRDirectory is stored in.- Specified by:
buildChildNode
in classMCRNode
- Parameters:
fo
- the FileObject representing the child in the underlying filesystem- Returns:
- an MCRFile or MCRDirectory child
-