Examples of ExtractionException


Examples of com.stimulus.archiva.exception.ExtractionException

            }
          }
        }
      }
      catch (Exception e) {
          throw new ExtractionException("could not extract Excel document",e,logger);
      } finally {
            if (out != null) {
               out.close();
            }
      }
      try {
          return new FileReader(file);
      } catch(Exception ex) {
          throw new ExtractionException("failed to extract text from powerpoint document",ex,logger);
      }
  }
View Full Code Here

Examples of com.stimulus.archiva.exception.ExtractionException

              writer = new FileWriter(file);
              DefaultStyledDocument doc = new DefaultStyledDocument();
              new RTFEditorKit().read(reader, doc, 0);
              writer.write(doc.getText(0, doc.getLength()));
          } catch (Exception ioe) {
              throw new ExtractionException("failed to parse rtf document", ioe,logger);
          }
          finally {
              if (reader != null) {
                  try {
                      reader.close();
                  } catch (IOException ioe) {}
              }

              if (writer != null) {
                  try {
                      writer.close();
                  } catch (IOException ioe) {}
              }
          }
          try {
            return new FileReader(file);
        } catch(Exception ex) {
            throw new ExtractionException("failed to extract text from powerpoint document",ex,logger);
        }
         
      }
View Full Code Here

Examples of com.stimulus.archiva.exception.ExtractionException

            tempFiles.markForDeletion(file);
            output = new FileOutputStream(file);
          reader.registerListener(this);
          reader.read(is);
      } catch (Exception ex) {
          throw new ExtractionException("failed to extract text from powerpoint document",ex,logger);
      finally {
            if (output != null) {
                try {
                    output.close();
                } catch (IOException ioe) {}
            }
        }
      try {
          return new FileReader(file);
      } catch(Exception ex) {
          throw new ExtractionException("failed to extract text from powerpoint document",ex,logger);
      }
  }
View Full Code Here

Examples of com.stimulus.archiva.exception.ExtractionException

       output.close();
       if(document != null)
          document.close();
     
     } catch (Exception e) {
         throw new ExtractionException("failed to extract pdf",e,logger);
     }
     try {
          return new FileReader(file);
     } catch(Exception ex) {
        throw new ExtractionException("failed to extract text from powerpoint document",ex,logger);
     }
}
View Full Code Here

Examples of com.stimulus.archiva.exception.ExtractionException

     logger.debug("returning stream containing converted word text for search indexing");
     return new InputStreamReader(textin);
     //return new StringReader("shuttle");
   } catch (IOException io) {
     io.printStackTrace();
     throw new ExtractionException("failed to extract text from word document {filename='" + filepath + "'}",io,logger);
   }
   //return new StringReader("");
}
View Full Code Here

Examples of com.stimulus.archiva.exception.ExtractionException

            }
          }
        }
      }
      catch (Exception e) {
          throw new ExtractionException("could not extract Excel document",e,logger);
      } finally {
            if (out != null) {
               out.close();
            }
      }
      try {
          return new FileReader(file);
      } catch(Exception ex) {
          throw new ExtractionException("failed to extract text from powerpoint document",ex,logger);
      }
  }
View Full Code Here

Examples of org.apache.any23.extractor.ExtractionException

        try {
            final URI documentURI = context.getDocumentURI();
            final Workbook workbook = createWorkbook(documentURI, in);
            processWorkbook(documentURI, workbook, er);
        } catch (Exception e) {
            throw new ExtractionException("An error occurred while extracting MS Excel content.", e);
        }
    }
View Full Code Here

Examples of org.apache.any23.extractor.ExtractionException

        StringWriter buffer = new StringWriter();
        try {
            getXSLT().applyTo(in, buffer);
        } catch (XSLTStylesheetException xslte) {
            throw new ExtractionException("An error occurred during the XSLT application.", xslte);
        }

        try {
            RDFParser parser
                    = RDFParserFactory.getInstance().getRDFXMLParser(
                        verifyDataType, stopAtFirstError, extractionContext, out
                    );
            parser.parse(
                    new StringReader(buffer.getBuffer().toString()),
                    extractionContext.getDocumentURI().stringValue()
            );
        } catch (RDFHandlerException ex) {
            throw new IllegalStateException(
                    "Should not happen, RDFHandlerAdapter does not throw RDFHandlerException", ex
            );
        } catch (RDFParseException ex) {
            throw new ExtractionException(
                    "Invalid RDF/XML produced by RDFa transform.", ex, out
            );
        }
    }
View Full Code Here

Examples of org.apache.any23.extractor.ExtractionException

             ExtractionResult out
     ) throws IOException, ExtractionException {
         try {
             parser.processDocument( new URL(extractionContext.getDocumentURI().toString() ), in, out );
         } catch (RDFa11ParserException rpe) {
             throw new ExtractionException("Error while performing extraction.", rpe);
         }
     }
View Full Code Here

Examples of org.apache.any23.extractor.ExtractionException

                        extractionRule.property,
                        ValueFactoryImpl.getInstance().createLiteral(content)
                );
            }
        } catch (BoilerpipeProcessingException bpe) {
            throw new ExtractionException("Error while applying text processor " + ArticleExtractor.class, bpe);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.