InputStream originalStream=null;
try {
originalStream = new BufferedInputStream(
url.openStream());
} catch (IOException e1) {
new CASException(e1);
}
// use custom parser or rely on autodetect
Parser parser = null;
if (mime!=null && mime.equals("")==false)
parser = config.getParser(mime);
// it that does not work
if (parser == null) {parser = new AutoDetectParser(config);}
Metadata md = new Metadata();
MarkupHandler handler = new MarkupHandler();
try {
parser.parse(originalStream,handler , md);
}
catch (Exception e){
// if we have a problem just dump the message and continue
// getLogger().log(Level.WARNING,"Problem converting file : "+URI+"\t"+e.getMessage());
// cas.setDocumentText(""); return;
throw new CASException(e);
}
finally {
// set language if it was explicitly specified as a configuration
// parameter
if (language != null) {