|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mycore.datamodel.ifs.MCRFilesystemNode
public abstract class MCRFilesystemNode
Represents a stored file or directory node with its metadata and content.
| Field Summary | |
|---|---|
protected boolean |
deleted
A flag indicating if this node is deleted and therefore invalid |
protected static DateFormat |
formatter
|
protected String |
ID
|
protected String |
label
The optional label of this node |
protected GregorianCalendar |
lastModified
The date of last modification of this node |
protected static MCRFileMetadataManager |
manager
|
protected String |
name
The name of this node |
protected String |
ownerID
The ID of the node owner, e .g. |
protected String |
parentID
The ID of the parent directory, if any |
protected long |
size
The size in number of bytes |
| Constructor Summary | |
|---|---|
protected |
MCRFilesystemNode(String name,
MCRDirectory parent)
|
protected |
MCRFilesystemNode(String name,
MCRDirectory parent,
boolean checkName)
|
protected |
MCRFilesystemNode(String name,
String ownerID)
|
protected |
MCRFilesystemNode(String ID,
String parentID,
String ownerID,
String name,
String label,
long size,
GregorianCalendar date)
|
| Method Summary | |
|---|---|
protected void |
checkName(String name,
boolean doExistCheck)
Changed method because of problems with update of files. |
void |
delete()
|
protected void |
ensureNotDeleted()
|
String |
getAbsolutePath()
|
Element |
getAdditionalData(String dataName)
Gets additional XML data stored for this node, if any. |
Document |
getAllAdditionalData()
Gets all additional XML data stored for this node, if any. |
String |
getID()
|
String |
getLabel()
Returns the label of this node |
GregorianCalendar |
getLastModified()
Returns the time of last modification of this node |
String |
getName()
Returns the name of this node |
static MCRFilesystemNode |
getNode(String ID)
|
String |
getOwnerID()
Returns the ID of the owner of this node |
MCRDirectory |
getParent()
|
String |
getParentID()
|
String |
getPath()
|
MCRDirectory |
getRootDirectory()
|
static MCRFilesystemNode |
getRootNode(String ownerID)
|
long |
getSize()
Returns the node size as number of bytes |
String |
getSizeFormatted()
Returns the node size, formatted as a string |
static String |
getSizeFormatted(long bytes)
Takes a file size in bytes and formats it as a string for output. |
boolean |
hasParent()
|
void |
removeAdditionalData(String dataName)
Removes additional XML data from this node. |
void |
removeAllAdditionalData()
Removes all additional XML data stored for this node, if any. |
void |
setAdditionalData(Element data)
Stores additional XML data for this node. |
void |
setLabel(String label)
Sets the label of this node |
void |
setName(String name)
Sets the name of this node |
protected void |
storeNew()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static MCRFileMetadataManager manager
protected String ID
protected String ownerID
protected String parentID
protected String name
protected String label
protected long size
protected GregorianCalendar lastModified
protected boolean deleted
protected static DateFormat formatter
| Constructor Detail |
|---|
protected MCRFilesystemNode(String name,
String ownerID)
protected MCRFilesystemNode(String name,
MCRDirectory parent)
protected MCRFilesystemNode(String name,
MCRDirectory parent,
boolean checkName)
protected MCRFilesystemNode(String ID,
String parentID,
String ownerID,
String name,
String label,
long size,
GregorianCalendar date)
| Method Detail |
|---|
public static MCRFilesystemNode getNode(String ID)
public static MCRFilesystemNode getRootNode(String ownerID)
protected void storeNew()
public void delete()
protected void checkName(String name,
boolean doExistCheck)
public String getID()
public String getOwnerID()
public String getParentID()
public MCRDirectory getParent()
public boolean hasParent()
public MCRDirectory getRootDirectory()
protected void ensureNotDeleted()
public void setName(String name)
public String getName()
public void setLabel(String label)
label - the label (may be null)public String getLabel()
public String getPath()
public String getAbsolutePath()
public long getSize()
public String getSizeFormatted()
public static String getSizeFormatted(long bytes)
public GregorianCalendar getLastModified()
public void setAdditionalData(Element data)
throws IOException,
JDOMException
data - the additional XML data to be saved
IOException - if the XML data can not be retrieved
JDOMException - if the XML data can not be parsed
public void removeAdditionalData(String dataName)
throws IOException,
JDOMException
dataName - the name of the additional XML data element to be removed
IOException - if the XML data can not be retrieved
JDOMException - if the XML data can not be parsedpublic void removeAllAdditionalData()
public Element getAdditionalData(String dataName)
throws IOException,
JDOMException
dataName - the name of the additional XML data element to be retrieved
IOException - if the XML data can not be retrieved
JDOMException - if the XML data can not be parsed
public Document getAllAdditionalData()
throws IOException,
JDOMException
IOException - if the XML data can not be retrieved
JDOMException - if the XML data can not be parsedpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||