"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/main/java/com/openkm/extractor/MsWordTextExtractor.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).

MsWordTextExtractor.java  (OpenKM-document-management-system-6.3.10):MsWordTextExtractor.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.hwpf.extractor.WordExtractor; import org.apache.poi.hwpf.extractor.WordExtractor;
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 Word documents. * Text extractor for Microsoft Word documents.
*/ */
@PluginImplementation
public class MsWordTextExtractor extends AbstractTextExtractor { public class MsWordTextExtractor extends AbstractTextExtractor {
/** /**
* Logger instance. * Logger instance.
*/ */
private static final Logger logger = LoggerFactory.getLogger(MsWordTextEx tractor.class); private static final Logger log = LoggerFactory.getLogger(MsWordTextExtra ctor.class);
/** /**
* Force loading of dependent class. * Force loading of dependent class.
*/ */
static { static {
WordExtractor.class.getName(); WordExtractor.class.getName();
} }
/** /**
* Creates a new <code>MsWordTextExtractor</code> instance. * Creates a new <code>MsWordTextExtractor</code> instance.
skipping to change at line 65 skipping to change at line 67
// -------------------------------------------------------< TextExtractor > // -------------------------------------------------------< TextExtractor >
/** /**
* {@inheritDoc} Returns an empty reader if an error occured extracting t ext from * {@inheritDoc} Returns an empty reader if an error occured extracting t ext from
* the word document. * the word document.
*/ */
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 {
return new WordExtractor(stream).getText(); return new WordExtractor(stream).getText();
} catch (Exception e) { } catch (Exception e) {
logger.warn("Failed to extract Word text content", e); log.warn("Failed to extract Word 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)