You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ni...@apache.org on 2015/05/11 08:29:17 UTC

svn commit: r1678677 - in /poi/trunk/src/java/org/apache/poi/poifs/filesystem: DirectoryNode.java OPOIFSFileSystem.java POIFSFileSystem.java

Author: nick
Date: Mon May 11 06:29:17 2015
New Revision: 1678677

URL: http://svn.apache.org/r1678677
Log:
Begin making NPOIFS the default #56791

Added:
    poi/trunk/src/java/org/apache/poi/poifs/filesystem/OPOIFSFileSystem.java
      - copied, changed from r1678676, poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java
Modified:
    poi/trunk/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java
    poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java

Modified: poi/trunk/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java?rev=1678677&r1=1678676&r2=1678677&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/filesystem/DirectoryNode.java Mon May 11 06:29:17 2015
@@ -37,8 +37,6 @@ import org.apache.poi.poifs.property.Pro
 
 /**
  * Simple implementation of DirectoryEntry
- *
- * @author Marc Johnson (mjohnson at apache dot org)
  */
 public class DirectoryNode
     extends EntryNode
@@ -50,9 +48,9 @@ public class DirectoryNode
     // Our list of entries, kept sorted to preserve order
     private ArrayList<Entry> _entries;
 
-   // Only one of these two will exist
-    // the POIFSFileSystem we belong to
-    private POIFSFileSystem   _ofilesystem;
+    // Only one of these two will exist
+    // the OPOIFSFileSystem we belong to
+    private OPOIFSFileSystem   _ofilesystem;
     // the NPOIFSFileSytem we belong to
     private NPOIFSFileSystem  _nfilesystem;
 
@@ -64,11 +62,11 @@ public class DirectoryNode
      * is intended strictly for the internal use of this package
      *
      * @param property the DirectoryProperty for this DirectoryEntry
-     * @param filesystem the POIFSFileSystem we belong to
+     * @param filesystem the OPOIFSFileSystem we belong to
      * @param parent the parent of this entry
      */
     DirectoryNode(final DirectoryProperty property,
-                  final POIFSFileSystem filesystem,
+                  final OPOIFSFileSystem filesystem,
                   final DirectoryNode parent)
     {
        this(property, parent, filesystem, (NPOIFSFileSystem)null);
@@ -86,12 +84,12 @@ public class DirectoryNode
                   final NPOIFSFileSystem nfilesystem,
                   final DirectoryNode parent)
     {
-       this(property, parent, (POIFSFileSystem)null, nfilesystem);
+       this(property, parent, (OPOIFSFileSystem)null, nfilesystem);
     }
 
     private DirectoryNode(final DirectoryProperty property,
                           final DirectoryNode parent,
-                          final POIFSFileSystem ofilesystem,
+                          final OPOIFSFileSystem ofilesystem,
                           final NPOIFSFileSystem nfilesystem)
     {
         super(property, parent);
@@ -147,9 +145,18 @@ public class DirectoryNode
 
     /**
      * @return the filesystem that this belongs to
+     * TODO Temporary workaround during #56791
      */
     public POIFSFileSystem getFileSystem()
     {
+        return (POIFSFileSystem)_ofilesystem;
+    }
+
+    /**
+     * @return the filesystem that this belongs to
+     */
+    public OPOIFSFileSystem getOFileSystem()
+    {
         return _ofilesystem;
     }
 

Copied: poi/trunk/src/java/org/apache/poi/poifs/filesystem/OPOIFSFileSystem.java (from r1678676, poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java)
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/filesystem/OPOIFSFileSystem.java?p2=poi/trunk/src/java/org/apache/poi/poifs/filesystem/OPOIFSFileSystem.java&p1=poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java&r1=1678676&r2=1678677&rev=1678677&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/filesystem/OPOIFSFileSystem.java Mon May 11 06:29:17 2015
@@ -54,17 +54,16 @@ import org.apache.poi.util.POILogFactory
 import org.apache.poi.util.POILogger;
 
 /**
- * This is the main class of the POIFS system; it manages the entire
- * life cycle of the filesystem.
- *
- * @author Marc Johnson (mjohnson at apache dot org)
+ * <p>This is the main class of the POIFS system; it manages the entire
+ * life cycle of the filesystem.</p>
+ * <p>This is the older version, which uses more memory, and doesn't
+ *  support in-place writes.</p>
  */
-
-public class POIFSFileSystem
+public class OPOIFSFileSystem
     implements POIFSViewable
 {
 	private static final POILogger _logger =
-		POILogFactory.getLogger(POIFSFileSystem.class);
+		POILogFactory.getLogger(OPOIFSFileSystem.class);
 
     /**
      * Convenience method for clients that want to avoid the auto-close behaviour of the constructor.
@@ -87,7 +86,7 @@ public class POIFSFileSystem
     /**
      * Constructor, intended for writing
      */
-    public POIFSFileSystem()
+    public OPOIFSFileSystem()
     {
         HeaderBlock header_block = new HeaderBlock(bigBlockSize);
         _property_table = new PropertyTable(header_block);
@@ -96,7 +95,7 @@ public class POIFSFileSystem
     }
 
     /**
-     * Create a POIFSFileSystem from an <tt>InputStream</tt>.  Normally the stream is read until
+     * Create a OPOIFSFileSystem from an <tt>InputStream</tt>.  Normally the stream is read until
      * EOF.  The stream is always closed.<p/>
      *
      * Some streams are usable after reaching EOF (typically those that return <code>true</code>
@@ -105,7 +104,7 @@ public class POIFSFileSystem
      * stream in order to trap the <tt>close()</tt> call.  A convenience method (
      * <tt>createNonClosingInputStream()</tt>) has been provided for this purpose:
      * <pre>
-     * InputStream wrappedStream = POIFSFileSystem.createNonClosingInputStream(is);
+     * InputStream wrappedStream = OPOIFSFileSystem.createNonClosingInputStream(is);
      * HSSFWorkbook wb = new HSSFWorkbook(wrappedStream);
      * is.reset();
      * doSomethingElse(is);
@@ -124,7 +123,7 @@ public class POIFSFileSystem
      * @exception IOException on errors reading, or on invalid data
      */
 
-    public POIFSFileSystem(InputStream stream)
+    public OPOIFSFileSystem(InputStream stream)
         throws IOException
     {
         this();
@@ -402,7 +401,7 @@ public class POIFSFileSystem
         FileInputStream  istream = new FileInputStream(args[ 0 ]);
         FileOutputStream ostream = new FileOutputStream(args[ 1 ]);
 
-        new POIFSFileSystem(istream).writeFilesystem(ostream);
+        new OPOIFSFileSystem(istream).writeFilesystem(ostream);
         istream.close();
         ostream.close();
     }
@@ -604,5 +603,5 @@ public class POIFSFileSystem
     }
 
     /* **********  END  begin implementation of POIFSViewable ********** */
-}   // end public class POIFSFileSystem
+}   // end public class OPOIFSFileSystem
 

Modified: poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java?rev=1678677&r1=1678676&r2=1678677&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java (original)
+++ poi/trunk/src/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java Mon May 11 06:29:17 2015
@@ -61,6 +61,7 @@ import org.apache.poi.util.POILogger;
  */
 
 public class POIFSFileSystem
+    extends OPOIFSFileSystem // TODO Temporary workaround during #56791
     implements POIFSViewable
 {
 	private static final POILogger _logger =



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org