aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2010-12-28 07:15:38 +0000
committerNick Burch <nick@apache.org>2010-12-28 07:15:38 +0000
commit8d19052b6a892ba7004d7251ecbee54feea15130 (patch)
treec9e2a8c905ef8e3a4848c830da9f38938b29ef4a /src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java
parentf88663e5bc645f64df6ffa328fb83a881c7528dc (diff)
downloadpoi-8d19052b6a892ba7004d7251ecbee54feea15130.tar.gz
poi-8d19052b6a892ba7004d7251ecbee54feea15130.zip
Add NPOIFS high level Document implementation
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1053273 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java')
-rw-r--r--src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java b/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java
index 5b0cfb6607..92261929ac 100644
--- a/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java
+++ b/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java
@@ -187,7 +187,6 @@ public class DirectoryNode
*
* @exception IOException
*/
-
DocumentEntry createDocument(final POIFSDocument document)
throws IOException
{
@@ -195,12 +194,30 @@ public class DirectoryNode
DocumentNode rval = new DocumentNode(property, this);
(( DirectoryProperty ) getProperty()).addChild(property);
+ _ofilesystem.addDocument(document);
- if(_ofilesystem != null) {
- _ofilesystem.addDocument(document);
- } else {
- _nfilesystem.addDocument(document);
- }
+ _entries.add(rval);
+ _byname.put(property.getName(), rval);
+ return rval;
+ }
+
+ /**
+ * create a new DocumentEntry
+ *
+ * @param document the new document
+ *
+ * @return the new DocumentEntry
+ *
+ * @exception IOException
+ */
+ DocumentEntry createDocument(final NPOIFSDocument document)
+ throws IOException
+ {
+ DocumentProperty property = document.getDocumentProperty();
+ DocumentNode rval = new DocumentNode(property, this);
+
+ (( DirectoryProperty ) getProperty()).addChild(property);
+ _nfilesystem.addDocument(document);
_entries.add(rval);
_byname.put(property.getName(), rval);
@@ -215,7 +232,6 @@ public class DirectoryNode
*
* @return true if the operation succeeded, else false
*/
-
boolean changeName(final String oldName, final String newName)
{
boolean rval = false;