Examples of ExtractionException


Examples of com.stimulus.archiva.exception.ExtractionException

                                break;
                    }
                }                      
           return new StringReader(textBuffer.toString());
       } catch (Exception io) {
         throw new ExtractionException("failed to extract text from open office:"+io.getMessage(),io,logger,Level.DEBUG);
       }
     }
View Full Code Here

Examples of com.stimulus.archiva.exception.ExtractionException

        reader.close();
       } catch(Exception e) {
         logger.error("failed to open txt file",e);
       }*/
     } catch (Exception e) {
         throw new ExtractionException("failed to extract pdf (probable password protected document)",e,logger,Level.DEBUG);
     } finally {
       try {
         if(document != null)
             document.close();
       } catch (IOException io) {}
     }
     try {
         logger.debug("returning extracted PDF data");
          return new FileReader(file);
     } catch(Exception ex) {
        throw new ExtractionException("failed to extract text from powerpoint document",ex,logger,Level.DEBUG);
     }
}
View Full Code Here

Examples of com.stimulus.archiva.exception.ExtractionException

        WordTextExtractorFactory wtef = new WordTextExtractorFactory();
        wtef.textExtractor(is).getText(out);
        out.close();
        return new InputStreamReader(new FileInputStream(file));
     } catch (Exception io) {
       throw new ExtractionException("failed to extract text from word document:"+io.getMessage(),io,logger,Level.DEBUG);
     }
   }
View Full Code Here

Examples of com.stimulus.archiva.exception.ExtractionException

                }
            }
          }
          return new StringReader(builder.toString());
    } catch (Exception ee) {
      throw new ExtractionException("failed to extract excel document",logger,Level.DEBUG);
    }
       
  }
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,Level.DEBUG);
        }
         
      }
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,Level.DEBUG);
      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,Level.DEBUG);
      }
  }
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
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.