Package org.apache.tika.io

Examples of org.apache.tika.io.TemporaryResources.dispose()


        TemporaryResources tmp = new TemporaryResources();
        try {
            parse(TikaInputStream.get(stream, tmp),
                    xhtml, metadata, tmp);
        } finally {
            tmp.dispose();
        }
    }

    private void parse(
            TikaInputStream stream, XHTMLContentHandler xhtml,
View Full Code Here


        try {
            TikaInputStream tis = TikaInputStream.get(stream, tmp);
            new ImageMetadataExtractor(metadata).parseJpeg(tis.getFile());
            new JempboxExtractor(metadata).parse(tis);
        } finally {
            tmp.dispose();
        }

        XHTMLContentHandler xhtml = new XHTMLContentHandler(handler, metadata);
        xhtml.startDocument();
        xhtml.endDocument();
View Full Code Here

                              suppressDuplicateOverlappingText, sortByPosition);
        } finally {
            if (pdfDocument != null) {
               pdfDocument.close();
            }
            tmp.dispose();
        }
    }

    private void extractMetadata(PDDocument document, Metadata metadata)
            throws TikaException {
View Full Code Here

                    // Recurse
                    extractor.extract(tis, extractor, handler);
                }
            } finally {
                tmp.dispose();
            }
        }

    }
View Full Code Here

                            TemporaryResources tmp = new TemporaryResources();
                            try {
                                TikaInputStream stream = TikaInputStream.get(archive, tmp);
                                extractor.parseEmbedded(stream, xhtml, entrydata, true);
                            } finally {
                                tmp.dispose();
                            }
                        }
                    } else if (name != null && name.length() > 0) {
                        xhtml.element("p", name);
                    }
View Full Code Here

            // All done
            xhtml.endDocument();

        } finally {
            tmp.dispose();
        }

    }
   
    private static void addMetadata(String key, Metadata m, Utf8AppleDataBox metadata) {
View Full Code Here

                if (taggedHandler != null) taggedHandler.throwIfCauseOf(e);
                throw new TikaException(
                        "TIKA-237: Illegal SAXException from " + parser, e);
            }
        } finally {
            tmp.dispose();
        }
    }

}
View Full Code Here

                // Convert zip bomb exceptions to TikaExceptions
                sch.throwIfCauseOf(e);
                throw e;
            }
        } finally {
            tmp.dispose();
        }
    }

    public void parse(
            InputStream stream, ContentHandler handler, Metadata metadata)
View Full Code Here

           
        } finally {
            if (pdfDocument != null) {
               pdfDocument.close();
            }
            tmp.dispose();
            //TODO: once we migrate to PDFBox 2.0, remove this (PDFBOX-2200)
            PDFont.clearResources();
        }
    }
View Full Code Here

          TemporaryResources tmp = new TemporaryResources();
          try {
            TikaInputStream tis = TikaInputStream.get(attach.getFileInputStream(), tmp);
            embeddedExtractor.parseEmbedded(tis, xhtml, attachMeta, true);
          } finally {
            tmp.dispose();
          }
        }
        xhtml.endElement("div");

      } catch (Exception e) {
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.