You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by ni...@apache.org on 2006/04/05 16:04:58 UTC
svn commit: r391617 - in
/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi:
hslf/extractor/PowerPointExtractor.java hwpf/extractor/WordExtractor.java
Author: nick
Date: Wed Apr 5 07:04:32 2006
New Revision: 391617
URL: http://svn.apache.org/viewcvs?rev=391617&view=rev
Log:
Add constructors taking the main objects, rather than just input streams
Modified:
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java
jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordExtractor.java
Modified: jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java
URL: http://svn.apache.org/viewcvs/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java?rev=391617&r1=391616&r2=391617&view=diff
==============================================================================
--- jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java (original)
+++ jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/extractor/PowerPointExtractor.java Wed Apr 5 07:04:32 2006
@@ -66,8 +66,8 @@
}
/**
- * Creates a PowerPointExtractor
- * @param fileName
+ * Creates a PowerPointExtractor, from a file
+ * @param fileName The name of the file to extract from
*/
public PowerPointExtractor(String fileName) throws IOException {
_hslfshow = new HSLFSlideShow(fileName);
@@ -77,8 +77,8 @@
}
/**
- * Creates a PowerPointExtractor
- * @param iStream
+ * Creates a PowerPointExtractor, from an Input Stream
+ * @param iStream The input stream containing the PowerPoint document
*/
public PowerPointExtractor(InputStream iStream) throws IOException {
_hslfshow = new HSLFSlideShow(iStream);
@@ -88,11 +88,22 @@
}
/**
- * Creates a PowerPointExtractor
- * @param fs
+ * Creates a PowerPointExtractor, from an open POIFSFileSystem
+ * @param fs the POIFSFileSystem containing the PowerPoint document
*/
public PowerPointExtractor(POIFSFileSystem fs) throws IOException {
_hslfshow = new HSLFSlideShow(fs);
+ _show = new SlideShow(_hslfshow);
+ _slides = _show.getSlides();
+ _notes = _show.getNotes();
+ }
+
+ /**
+ * Creates a PowerPointExtractor, from a HSLFSlideShow
+ * @param ss the HSLFSlideShow to extract text from
+ */
+ public PowerPointExtractor(HSLFSlideShow ss) throws IOException {
+ _hslfshow = ss;
_show = new SlideShow(_hslfshow);
_slides = _show.getSlides();
_notes = _show.getNotes();
Modified: jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordExtractor.java
URL: http://svn.apache.org/viewcvs/jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordExtractor.java?rev=391617&r1=391616&r2=391617&view=diff
==============================================================================
--- jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordExtractor.java (original)
+++ jakarta/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordExtractor.java Wed Apr 5 07:04:32 2006
@@ -36,8 +36,16 @@
* @param fs POIFSFileSystem containing the word file
*/
public WordExtractor(POIFSFileSystem fs) throws IOException {
+ this(new HWPFDocument(fs));
this.fs = fs;
- doc = new HWPFDocument(fs);
+ }
+
+ /**
+ * Create a new Word Extractor
+ * @param doc The HWPFDocument to extract from
+ */
+ public WordExtractor(HWPFDocument doc) throws IOException {
+ this.doc = doc;
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/