Abstract implementation of Entry
Extending classes should override isDocument() or isDirectory(), as
appropriate
Extending classes must override isDeleteOK()
| Method from org.apache.cocoon.poi.poifs.filesystem.EntryNode Detail: |
public boolean delete() {
boolean rval = false;
if ((!isRoot()) && isDeleteOK())
{
rval = _parent.deleteEntry(this);
}
return rval;
}
Delete this Entry. This operation should succeed, but there are
special circumstances when it will not:
If this Entry is the root of the Entry tree, it cannot be
deleted, as there is no way to create another one.
If this Entry is a directory, it cannot be deleted unless it is
empty. |
public String getName() {
return _property.getName();
}
get the name of the Entry |
public DirectoryEntry getParent() {
return _parent;
}
get this Entry's parent (the DocumentEntry that owns this
Entry). All Entry objects, except the root Entry, has a parent. |
protected Property getProperty() {
return _property;
}
grant access to the property |
abstract protected boolean isDeleteOK()
extensions use this method to verify internal rules regarding
deletion of the underlying store. |
public boolean isDirectoryEntry() {
return false;
}
is this a DirectoryEntry? |
public boolean isDocumentEntry() {
return false;
}
|
protected boolean isRoot() {
// only the root Entry has no parent ...
return (_parent == null);
}
is this the root of the tree? |
public boolean renameTo(String newName) {
boolean rval = false;
if (!isRoot())
{
rval = _parent.changeName(getName(), newName);
}
return rval;
}
Rename this Entry. This operation will fail if:
There is a sibling Entry (i.e., an Entry whose parent is the
same as this Entry's parent) with the same name.
This Entry is the root of the Entry tree. Its name is dictated
by the Filesystem and many not be changed. |