|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mycore.datamodel.ifs2.MCRNode
org.mycore.datamodel.ifs2.MCRStoredNode
org.mycore.datamodel.ifs2.MCRFile
public class MCRFile
Represents a file stored in a file collection. This is a file that is imported from outside the system, and may be updated and modified afterwards.
| Field Summary | |
|---|---|
static String |
MD5_OF_EMPTY_FILE
The md5 checksum of the empty file |
| Fields inherited from class org.mycore.datamodel.ifs2.MCRStoredNode |
|---|
data |
| Fields inherited from class org.mycore.datamodel.ifs2.MCRNode |
|---|
fo, parent |
| Constructor Summary | |
|---|---|
protected |
MCRFile(MCRDirectory parent,
org.apache.commons.vfs.FileObject fo,
Element data)
Returns a MCRFile object representing an existing file already stored in the store. |
protected |
MCRFile(MCRDirectory parent,
String name)
Creates a new MCRFile that does not exist yet |
| Method Summary | |
|---|---|
protected MCRVirtualNode |
buildChildNode(org.apache.commons.vfs.FileObject fo)
Returns a MCRVirtualNode contained in this file as a child. |
String |
getExtension()
Returns the file name extension, which is the part after the last dot in the filename. |
File |
getLocalFile()
Returns the local java.io.File representing this stored file. |
String |
getMD5()
Returns the md5 checksum of the file's content. |
(package private) void |
repairMetadata()
Repairs additional metadata of this file and all its children |
String |
setContent(MCRContent source)
Sets the content of this file. |
| Methods inherited from class org.mycore.datamodel.ifs2.MCRStoredNode |
|---|
clearLabels, delete, getCurrentLabel, getLabel, getLabels, renameTo, setLabel, setLastModified |
| Methods inherited from class org.mycore.datamodel.ifs2.MCRNode |
|---|
getChild, getChildren, getContent, getLastModified, getName, getNodeByPath, getNumChildren, getParent, getPath, getRandomAccessContent, getRoot, getSize, hasChildren, isDirectory, isFile |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String MD5_OF_EMPTY_FILE
| Constructor Detail |
|---|
protected MCRFile(MCRDirectory parent,
org.apache.commons.vfs.FileObject fo,
Element data)
throws Exception
parent - the parent directory containing this filefo - the file in the local underlying filesystem storing this file
Exception
protected MCRFile(MCRDirectory parent,
String name)
throws Exception
parent - the parent directoryname - the file name
Exception| Method Detail |
|---|
protected MCRVirtualNode buildChildNode(org.apache.commons.vfs.FileObject fo)
throws Exception
buildChildNode in class MCRNodefo - the FileObject representing the child in the underlying
filesystem
Exceptionpublic String getMD5()
public String getExtension()
public String setContent(MCRContent source)
throws Exception
content - the content to be read
Exception
public File getLocalFile()
throws Exception
Exception
void repairMetadata()
throws Exception
repairMetadata in class MCRStoredNodeException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||