Examples of throwIfCauseOf()


Examples of org.apache.tika.io.TaggedInputStream.throwIfCauseOf()

            parser.parse(taggedStream, taggedHandler, metadata, context);
        } catch (RuntimeException e) {
            throw new TikaException(
                    "Unexpected RuntimeException from " + parser, e);
        } catch (IOException e) {
            taggedStream.throwIfCauseOf(e);
            throw new TikaException(
                    "TIKA-198: Illegal IOException from " + parser, e);
        } catch (SAXException e) {
            taggedHandler.throwIfCauseOf(e);
            throw new TikaException(
View Full Code Here

Examples of org.apache.tika.io.TaggedInputStream.throwIfCauseOf()

            parser.parse(taggedStream, taggedHandler, metadata, context);
        } catch (RuntimeException e) {
            throw new TikaException(
                    "Unexpected RuntimeException from " + parser, e);
        } catch (IOException e) {
            taggedStream.throwIfCauseOf(e);
            throw new TikaException(
                    "TIKA-198: Illegal IOException from " + parser, e);
        } catch (SAXException e) {
            taggedHandler.throwIfCauseOf(e);
            throw new TikaException(
View Full Code Here

Examples of org.apache.tika.io.TaggedInputStream.throwIfCauseOf()

            parser.parse(taggedStream, taggedHandler, metadata, context);
        } catch (RuntimeException e) {
            throw new TikaException(
                    "Unexpected RuntimeException from " + parser, e);
        } catch (IOException e) {
            taggedStream.throwIfCauseOf(e);
            throw new TikaException(
                    "TIKA-198: Illegal IOException from " + parser, e);
        } catch (SAXException e) {
            taggedHandler.throwIfCauseOf(e);
            throw new TikaException(
View Full Code Here

Examples of org.apache.tika.io.TaggedInputStream.throwIfCauseOf()

        try {
            final TextExtractor ert = new TextExtractor(new XHTMLContentHandler(handler, metadata), metadata);
            ert.extract(stream);
            metadata.add(Metadata.CONTENT_TYPE, "application/rtf");
        } catch (IOException e) {
            tagged.throwIfCauseOf(e);
            throw new TikaException("Error parsing an RTF document", e);
        }
    }
}
View Full Code Here

Examples of org.apache.tika.io.TaggedInputStream.throwIfCauseOf()

        parser.setContentDecoding(true);
        TaggedInputStream tagged = TaggedInputStream.get(stream);
        try {
            parser.parse(tagged);
        } catch (IOException e) {
            tagged.throwIfCauseOf(e);
            throw new TikaException("Failed to parse an email message", e);
        } catch (MimeException e) {
            // Unwrap the exception in case it was not thrown by mime4j
            Throwable cause = e.getCause();
            if (cause instanceof TikaException) {
View Full Code Here

Examples of org.apache.tika.io.TaggedInputStream.throwIfCauseOf()

        parser.setContentDecoding(true);
        TaggedInputStream tagged = TaggedInputStream.get(stream);
        try {
            parser.parse(tagged);
        } catch (IOException e) {
            tagged.throwIfCauseOf(e);
            throw new TikaException("Failed to parse an email message", e);
        } catch (MimeException e) {
            // Unwrap the exception in case it was not thrown by mime4j
            Throwable cause = e.getCause();
            if (cause instanceof TikaException) {
View Full Code Here

Examples of org.apache.tika.io.TaggedInputStream.throwIfCauseOf()

        try {
            final TextExtractor ert = new TextExtractor(new XHTMLContentHandler(handler, metadata), metadata);
            ert.extract(stream);
            metadata.add(Metadata.CONTENT_TYPE, "application/rtf");
        } catch (IOException e) {
            tagged.throwIfCauseOf(e);
            throw new TikaException("Error parsing an RTF document", e);
        }
    }
}
View Full Code Here

Examples of org.apache.tika.io.TaggedInputStream.throwIfCauseOf()

        parser.setContentDecoding(true);
        TaggedInputStream tagged = TaggedInputStream.get(stream);
        try {
            parser.parse(tagged);
        } catch (IOException e) {
            tagged.throwIfCauseOf(e);
            throw new TikaException("Failed to parse an email message", e);
        } catch (MimeException e) {
            // Unwrap the exception in case it was not thrown by mime4j
            Throwable cause = e.getCause();
            if (cause instanceof TikaException) {
View Full Code Here

Examples of org.apache.tika.io.TaggedInputStream.throwIfCauseOf()

                names.add(entry.getName());
            }
            return names;
        } catch (IOException e) {
            // Was this a real I/O problem?
            tagged.throwIfCauseOf(e);
            // Parse error in POI, so we don't know the file type
            return Collections.emptySet();
        } catch (RuntimeException e) {
            // Another problem in POI
            return Collections.emptySet();
View Full Code Here

Examples of org.apache.tika.io.TaggedInputStream.throwIfCauseOf()

                    new TextExtractor(new XHTMLContentHandler(handler,
                    metadata), metadata, embObjHandler);
            ert.extract(stream);
            metadata.add(Metadata.CONTENT_TYPE, "application/rtf");
        } catch (IOException e) {
            tagged.throwIfCauseOf(e);
            throw new TikaException("Error parsing an RTF document", 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.