Add constructors taking the main objects, rather than just input streams

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@391617 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2006-04-05 14:04:32 +00:00
parent 1e70a2efc7
commit 0ce1e5a77c
2 changed files with 26 additions and 7 deletions

View File

@ -66,8 +66,8 @@ public class PowerPointExtractor
}
/**
* 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 @@ public class PowerPointExtractor
}
/**
* 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,8 +88,8 @@ public class PowerPointExtractor
}
/**
* 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);
@ -98,6 +98,17 @@ public class PowerPointExtractor
_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();
}
/**
* Shuts down the underlying streams

View File

@ -36,8 +36,16 @@ public class WordExtractor {
* @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;
}
/**