"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/main/java/com/openkm/extractor/MsExcelTextExtractor.java" between
OpenKM-document-management-system-6.3.10.tar.gz and OpenKM-document-management-system-6.3.11.tar.gz

About: OpenKM (Knowledge Management) is a document management system that allows easy management of documents, users, roles and finding your enterprise documents and records. Community version (source code).

MsExcelTextExtractor.java  (OpenKM-document-management-system-6.3.10):MsExcelTextExtractor.java  (OpenKM-document-management-system-6.3.11)
skipping to change at line 24 skipping to change at line 24
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* <p> * <p>
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/ */
package com.openkm.extractor; package com.openkm.extractor;
import net.xeoh.plugins.base.annotations.PluginImplementation;
import org.apache.poi.hssf.extractor.ExcelExtractor; import org.apache.poi.hssf.extractor.ExcelExtractor;
import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
/** /**
* Text extractor for Microsoft Excel sheets. * Text extractor for Microsoft Excel sheets.
*/ */
@PluginImplementation
public class MsExcelTextExtractor extends AbstractTextExtractor { public class MsExcelTextExtractor extends AbstractTextExtractor {
/** /**
* Logger instance. * Logger instance.
*/ */
private static final Logger logger = LoggerFactory.getLogger(MsExcelTextE xtractor.class); private static final Logger log = LoggerFactory.getLogger(MsExcelTextExtr actor.class);
/** /**
* Force loading of dependent class. * Force loading of dependent class.
*/ */
static { static {
POIFSFileSystem.class.getName(); POIFSFileSystem.class.getName();
} }
/** /**
* Creates a new <code>MsExcelTextExtractor</code> instance. * Creates a new <code>MsExcelTextExtractor</code> instance.
skipping to change at line 66 skipping to change at line 68
// -------------------------------------------------------< TextExtractor > // -------------------------------------------------------< TextExtractor >
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
public String extractText(InputStream stream, String type, String encodin g) throws IOException { public String extractText(InputStream stream, String type, String encodin g) throws IOException {
try { try {
POIFSFileSystem fs = new POIFSFileSystem(stream); POIFSFileSystem fs = new POIFSFileSystem(stream);
return new ExcelExtractor(fs).getText(); return new ExcelExtractor(fs).getText();
} catch (RuntimeException e) { } catch (RuntimeException e) {
logger.warn("Failed to extract Excel text content", e); log.warn("Failed to extract Excel text content", e);
throw new IOException(e.getMessage(), e); throw new IOException(e.getMessage(), e);
} finally { } finally {
stream.close(); stream.close();
} }
} }
} }
 End of changes. 4 change blocks. 
2 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)