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 2011/03/25 17:21:09 UTC

svn commit: r1085447 - in /poi/trunk/src/scratchpad/src/org/apache/poi: hdgf/ hdgf/extractor/ hslf/ hslf/extractor/ hsmf/ hsmf/extractor/

Author: nick
Date: Fri Mar 25 16:21:09 2011
New Revision: 1085447

URL: http://svn.apache.org/viewvc?rev=1085447&view=rev
Log:
More NPOIFS Constructor updates

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/extractor/VisioTextExtractor.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/extractor/OutlookTextExtactor.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java?rev=1085447&r1=1085446&r2=1085447&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/HDGFDiagram.java Fri Mar 25 16:21:09 2011
@@ -31,6 +31,7 @@ import org.apache.poi.hdgf.streams.Strin
 import org.apache.poi.hdgf.streams.TrailerStream;
 import org.apache.poi.poifs.filesystem.DirectoryNode;
 import org.apache.poi.poifs.filesystem.DocumentEntry;
+import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
 import org.apache.poi.util.LittleEndian;
 
@@ -56,10 +57,20 @@ public final class HDGFDiagram extends P
 	private PointerFactory ptrFactory;
 
 	public HDGFDiagram(POIFSFileSystem fs) throws IOException {
-		this(fs.getRoot(), fs);
+		this(fs.getRoot());
 	}
-	public HDGFDiagram(DirectoryNode dir, POIFSFileSystem fs) throws IOException {
-		super(dir, fs);
+   public HDGFDiagram(NPOIFSFileSystem fs) throws IOException {
+      this(fs.getRoot());
+   }
+   /**
+    * @deprecated Use {@link #HDGFDiagram(DirectoryNode)} instead 
+    */
+   @Deprecated
+   public HDGFDiagram(DirectoryNode dir, POIFSFileSystem fs) throws IOException {
+      this(dir);
+   }
+	public HDGFDiagram(DirectoryNode dir) throws IOException {
+		super(dir);
 
 		DocumentEntry docProps =
 			(DocumentEntry)dir.getEntry("VisioDocument");

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/extractor/VisioTextExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/extractor/VisioTextExtractor.java?rev=1085447&r1=1085446&r2=1085447&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/extractor/VisioTextExtractor.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hdgf/extractor/VisioTextExtractor.java Fri Mar 25 16:21:09 2011
@@ -30,6 +30,7 @@ import org.apache.poi.hdgf.streams.Chunk
 import org.apache.poi.hdgf.streams.PointerContainingStream;
 import org.apache.poi.hdgf.streams.Stream;
 import org.apache.poi.poifs.filesystem.DirectoryNode;
+import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
 
 /**
@@ -39,18 +40,26 @@ import org.apache.poi.poifs.filesystem.P
  */
 public final class VisioTextExtractor extends POIOLE2TextExtractor {
 	private HDGFDiagram hdgf;
-	private POIFSFileSystem fs;
 
 	public VisioTextExtractor(HDGFDiagram hdgf) {
 		super(hdgf);
 		this.hdgf = hdgf;
 	}
 	public VisioTextExtractor(POIFSFileSystem fs) throws IOException {
-		this(fs.getRoot(), fs);
+		this(fs.getRoot());
 	}
+   public VisioTextExtractor(NPOIFSFileSystem fs) throws IOException {
+      this(fs.getRoot());
+   }
+   public VisioTextExtractor(DirectoryNode dir) throws IOException {
+      this(new HDGFDiagram(dir));
+   }
+   /**
+    * @deprecated Use {@link #VisioTextExtractor(DirectoryNode)} instead 
+    */
+   @Deprecated
 	public VisioTextExtractor(DirectoryNode dir, POIFSFileSystem fs) throws IOException {
 		this(new HDGFDiagram(dir, fs));
-		this.fs = fs;
 	}
 	public VisioTextExtractor(InputStream inp) throws IOException {
 		this(new POIFSFileSystem(inp));

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java?rev=1085447&r1=1085446&r2=1085447&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/HSLFSlideShow.java Fri Mar 25 16:21:09 2011
@@ -46,6 +46,7 @@ import org.apache.poi.hslf.usermodel.Pic
 import org.apache.poi.poifs.filesystem.DirectoryNode;
 import org.apache.poi.poifs.filesystem.DocumentEntry;
 import org.apache.poi.poifs.filesystem.DocumentInputStream;
+import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
 import org.apache.poi.util.LittleEndian;
 import org.apache.poi.util.POILogFactory;
@@ -129,14 +130,28 @@ public final class HSLFSlideShow extends
 	}
 
    /**
+    * Constructs a Powerpoint document from a POIFS Filesystem. Parses the
+    * document and places all the important stuff into data structures.
+    *
+    * @param filesystem the POIFS FileSystem to read from
+    * @throws IOException if there is a problem while parsing the document.
+    */
+   public HSLFSlideShow(NPOIFSFileSystem filesystem) throws IOException
+   {
+      this(filesystem.getRoot());
+   }
+
+   /**
     * Constructs a Powerpoint document from a specific point in a
     *  POIFS Filesystem. Parses the document and places all the
     *  important stuff into data structures.
     *
+    * @deprecated Use {@link #HSLFSlideShow(DirectoryNode)} instead
     * @param dir the POIFS directory to read from
     * @param filesystem the POIFS FileSystem to read from
     * @throws IOException if there is a problem while parsing the document.
     */
+	@Deprecated
    public HSLFSlideShow(DirectoryNode dir, POIFSFileSystem filesystem) throws IOException
    {
       this(dir);

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java?rev=1085447&r1=1085446&r2=1085447&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java Fri Mar 25 16:21:09 2011
@@ -29,6 +29,7 @@ import org.apache.poi.hslf.HSLFSlideShow
 import org.apache.poi.hslf.model.*;
 import org.apache.poi.hslf.usermodel.SlideShow;
 import org.apache.poi.poifs.filesystem.DirectoryNode;
+import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
 
 /**
@@ -100,9 +101,32 @@ public final class PowerPointExtractor e
 	 * @param fs the POIFSFileSystem containing the PowerPoint document
 	 */
 	public PowerPointExtractor(POIFSFileSystem fs) throws IOException {
-		this(new HSLFSlideShow(fs));
+		this(fs.getRoot());
 	}
 
+   /**
+    * Creates a PowerPointExtractor, from an open NPOIFSFileSystem
+    *
+    * @param fs the NPOIFSFileSystem containing the PowerPoint document
+    */
+   public PowerPointExtractor(NPOIFSFileSystem fs) throws IOException {
+      this(fs.getRoot());
+   }
+
+   /**
+    * Creates a PowerPointExtractor, from a specific place
+    *  inside an open NPOIFSFileSystem
+    *
+    * @param dir the POIFS Directory containing the PowerPoint document
+    */
+   public PowerPointExtractor(DirectoryNode dir) throws IOException {
+      this(new HSLFSlideShow(dir));
+   }
+
+   /**
+    * @deprecated Use {@link #PowerPointExtractor(DirectoryNode)} instead
+    */
+   @Deprecated
 	public PowerPointExtractor(DirectoryNode dir, POIFSFileSystem fs) throws IOException {
 		this(new HSLFSlideShow(dir, fs));
 	}

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java?rev=1085447&r1=1085446&r2=1085447&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/MAPIMessage.java Fri Mar 25 16:21:09 2011
@@ -41,6 +41,7 @@ import org.apache.poi.hsmf.datatypes.Str
 import org.apache.poi.hsmf.exceptions.ChunkNotFoundException;
 import org.apache.poi.hsmf.parsers.POIFSChunkParser;
 import org.apache.poi.poifs.filesystem.DirectoryNode;
+import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
 
 /**
@@ -92,7 +93,22 @@ public class MAPIMessage extends POIDocu
     * @throws IOException
     */
    public MAPIMessage(POIFSFileSystem fs) throws IOException {
-      this(fs.getRoot(), fs);
+      this(fs.getRoot());
+   }
+   /**
+    * Constructor for reading MSG Files from a POIFS filesystem
+    * @param fs
+    * @throws IOException
+    */
+   public MAPIMessage(NPOIFSFileSystem fs) throws IOException {
+      this(fs.getRoot());
+   }
+   /**
+    * @deprecated Use {@link #MAPIMessage(DirectoryNode)} instead
+    */
+   @Deprecated
+   public MAPIMessage(DirectoryNode poifsDir, POIFSFileSystem fs) throws IOException {
+      this(poifsDir);
    }
    /**
     * Constructor for reading MSG Files from a certain
@@ -101,7 +117,7 @@ public class MAPIMessage extends POIDocu
     * @param fs
     * @throws IOException
     */
-   public MAPIMessage(DirectoryNode poifsDir, POIFSFileSystem fs) throws IOException {
+   public MAPIMessage(DirectoryNode poifsDir) throws IOException {
       super(poifsDir);
 
       // Grab all the chunks

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/extractor/OutlookTextExtactor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/extractor/OutlookTextExtactor.java?rev=1085447&r1=1085446&r2=1085447&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/extractor/OutlookTextExtactor.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hsmf/extractor/OutlookTextExtactor.java Fri Mar 25 16:21:09 2011
@@ -25,6 +25,7 @@ import org.apache.poi.hsmf.MAPIMessage;
 import org.apache.poi.hsmf.datatypes.AttachmentChunks;
 import org.apache.poi.hsmf.exceptions.ChunkNotFoundException;
 import org.apache.poi.poifs.filesystem.DirectoryNode;
+import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
 import org.apache.poi.util.StringUtil.StringsIterator;
 
@@ -36,12 +37,22 @@ public class OutlookTextExtactor extends
    public OutlookTextExtactor(MAPIMessage msg) {
       super(msg);
    }
+   /**
+    * Use {@link #OutlookTextExtactor(DirectoryNode)} instead
+    */
+   @Deprecated
    public OutlookTextExtactor(DirectoryNode poifsDir, POIFSFileSystem fs) throws IOException {
       this(new MAPIMessage(poifsDir, fs));
    }
+   public OutlookTextExtactor(DirectoryNode poifsDir) throws IOException {
+      this(new MAPIMessage(poifsDir));
+   }
    public OutlookTextExtactor(POIFSFileSystem fs) throws IOException {
       this(new MAPIMessage(fs));
    }
+   public OutlookTextExtactor(NPOIFSFileSystem fs) throws IOException {
+      this(new MAPIMessage(fs));
+   }
    public OutlookTextExtactor(InputStream inp) throws IOException {
       this(new MAPIMessage(inp));
    }



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