| Method from org.apache.cocoon.poi.poifs.filesystem.DirectoryNode Detail: |
boolean changeName(String oldName,
String newName) {
boolean rval = false;
EntryNode child = ( EntryNode ) _entries.get(oldName);
if (child != null)
{
rval = (( DirectoryProperty ) getProperty())
.changeName(child.getProperty(), newName);
if (rval)
{
_entries.remove(oldName);
_entries.put(child.getProperty().getName(), child);
}
}
return rval;
}
Change a contained Entry's name |
public DirectoryEntry createDirectory(String name) throws IOException {
DirectoryProperty property = new DirectoryProperty(name);
DirectoryNode rval = new DirectoryNode(property, _filesystem,
this);
(( DirectoryProperty ) getProperty()).addChild(property);
_filesystem.addDirectory(property);
_entries.put(name, rval);
return rval;
}
create a new DirectoryEntry |
DocumentEntry createDocument(Document document) throws IOException {
DocumentProperty property = document.getDocumentProperty();
DocumentNode rval = new DocumentNode(property, this);
(( DirectoryProperty ) getProperty()).addChild(property);
_filesystem.addDocument(document);
_entries.put(property.getName(), rval);
return rval;
}
create a new DocumentEntry |
public DocumentEntry createDocument(String name,
InputStream stream) throws IOException {
return createDocument(new Document(name, stream));
}
create a new DocumentEntry |
boolean deleteEntry(EntryNode entry) {
boolean rval =
(( DirectoryProperty ) getProperty())
.deleteChild(entry.getProperty());
if (rval)
{
_entries.remove(entry.getName());
_filesystem.remove(entry);
}
return rval;
}
|
public Iterator getEntries() {
return _entries.values().iterator();
}
get an iterator of the Entry instances contained directly in
this instance (in other words, children only; no grandchildren
etc.) |
public Entry getEntry(String name) throws FileNotFoundException {
Entry rval = null;
if (name != null)
{
rval = ( Entry ) _entries.get(name);
}
if (rval == null)
{
// either a null name was given, or there is no such name
throw new FileNotFoundException("no such entry: \"" + name
+ "\"");
}
return rval;
}
get a specified Entry by name |
public int getEntryCount() {
return _entries.size();
}
find out how many Entry instances are contained directly within
this DirectoryEntry |
protected boolean isDeleteOK() {
// if this directory is empty, we can delete it
return isEmpty();
}
extensions use this method to verify internal rules regarding
deletion of the underlying store. |
public boolean isDirectoryEntry() {
return true;
}
is this a DirectoryEntry? |
public boolean isEmpty() {
return _entries.isEmpty();
}
is this DirectoryEntry empty? |