"Fossies" - the Fresh Open Source Software Archive  

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

HTMLTextExtractor.java  (OpenKM-document-management-system-6.3.10):HTMLTextExtractor.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.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.xml.sax.InputSource; import org.xml.sax.InputSource;
import org.xml.sax.helpers.DefaultHandler; import org.xml.sax.helpers.DefaultHandler;
import javax.xml.transform.Transformer; import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory; import javax.xml.transform.TransformerFactory;
import javax.xml.transform.sax.SAXResult; import javax.xml.transform.sax.SAXResult;
import javax.xml.transform.sax.SAXSource; import javax.xml.transform.sax.SAXSource;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.Reader; import java.io.Reader;
/** /**
* Text extractor for HyperText Markup Language (HTML). * Text extractor for HyperText Markup Language (HTML).
*/ */
@PluginImplementation
public class HTMLTextExtractor extends AbstractTextExtractor { public class HTMLTextExtractor extends AbstractTextExtractor {
/** /**
* Logger instance. * Logger instance.
*/ */
private static final Logger logger = LoggerFactory.getLogger(HTMLTextExtr actor.class); private static final Logger log = LoggerFactory.getLogger(HTMLTextExtract or.class);
/** /**
* Creates a new <code>HTMLTextExtractor</code> instance. * Creates a new <code>HTMLTextExtractor</code> instance.
*/ */
public HTMLTextExtractor() { public HTMLTextExtractor() {
super(new String[]{"text/html"}); super(new String[]{"text/html"});
} }
// -------------------------------------------------------< TextExtractor > // -------------------------------------------------------< TextExtractor >
skipping to change at line 80 skipping to change at line 81
if (encoding != null) { if (encoding != null) {
reader = new InputStreamReader(stream, encoding); reader = new InputStreamReader(stream, encoding);
} else { } else {
reader = new InputStreamReader(stream); reader = new InputStreamReader(stream);
} }
SAXSource source = new SAXSource(parser, new InputSource( reader)); SAXSource source = new SAXSource(parser, new InputSource( reader));
transformer.transform(source, result); transformer.transform(source, result);
return parser.getContents(); return parser.getContents();
} catch (TransformerConfigurationException e) {
logger.warn("Failed to extract HTML text content", e);
throw new IOException(e.getMessage(), e);
} catch (TransformerException e) { } catch (TransformerException e) {
logger.warn("Failed to extract HTML text content", e); log.warn("Failed to extract HTML text content", e);
throw new IOException(e.getMessage(), e); throw new IOException(e.getMessage(), e);
} finally { } finally {
stream.close(); stream.close();
} }
} }
} }
 End of changes. 6 change blocks. 
6 lines changed or deleted 4 lines changed or added

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