View | Details | Raw Unified | Return to bug 46544
Collapse All | Expand All

(-)ExcelExtractor.java.orig (-1 / +25 lines)
Lines 18-23 Link Here
18
package org.apache.poi.hssf.extractor;
18
package org.apache.poi.hssf.extractor;
19
19
20
import java.io.IOException;
20
import java.io.IOException;
21
import java.io.InputStream;
22
import java.io.FileInputStream;
21
23
22
import org.apache.poi.POIOLE2TextExtractor;
24
import org.apache.poi.POIOLE2TextExtractor;
23
import org.apache.poi.ss.usermodel.HeaderFooter;
25
import org.apache.poi.ss.usermodel.HeaderFooter;
Lines 51-63 Link Here
51
		super(wb);
53
		super(wb);
52
		this.wb = wb;
54
		this.wb = wb;
53
	}
55
	}
56
57
	public ExcelExtractor(String fileName) throws IOException {
58
		this(new FileInputStream(fileName));
59
	}
60
61
	public ExcelExtractor(InputStream iStream) throws IOException {
62
		this(new POIFSFileSystem(iStream));
63
	}
64
54
	public ExcelExtractor(POIFSFileSystem fs) throws IOException {
65
	public ExcelExtractor(POIFSFileSystem fs) throws IOException {
55
		this(fs.getRoot(), fs);
66
		this(fs.getRoot(), fs);
56
	}
67
	}
57
	public ExcelExtractor(DirectoryNode dir, POIFSFileSystem fs) throws IOException {
68
	public ExcelExtractor(DirectoryNode dir, POIFSFileSystem fs) throws IOException {
58
		this(new HSSFWorkbook(dir, fs, true));
69
		this(new HSSFWorkbook(dir, fs, true));
59
	}
70
	}
60
	
71
72
	/**
73
	 * Command line extractor.
74
	 */
75
	public static void main(String[] args) throws Exception {
76
		if(args.length < 1) {
77
			System.err.println("Use:");
78
			System.err.println("   java org.apache.poi.hssf.extractor.ExcelExtractor <filename.xls>");
79
			System.exit(1);
80
		}
81
82
		ExcelExtractor extractor = new ExcelExtractor(args[0]);
83
		System.out.println(extractor.getText());
84
	}
61
85
62
	/**
86
	/**
63
	 * Should sheet names be included? Default is true
87
	 * Should sheet names be included? Default is true

Return to bug 46544