Package org.apache.tika.exception

Examples of org.apache.tika.exception.TikaException


                        }
                    }
                }
            }
        } catch (InvalidFormatException e) {
            throw new TikaException("Broken OOXML file", e);
        }
    }
View Full Code Here


        InputStreamReader isr;
        try {
            // Headers are going to be 7-bit ascii
            isr = new InputStreamReader(stream, "US-ASCII");
        } catch (UnsupportedEncodingException e) {
            throw new TikaException("US-ASCII is not supported!", e);
        }

        BufferedReader reader = new BufferedReader(isr);

        metadata.set(Metadata.CONTENT_TYPE, MBOX_MIME_TYPE);
View Full Code Here

                   throw (IOException)exception;
                if(exception instanceof SAXException)
                   throw (SAXException)exception;
                if(exception instanceof TikaException)
                   throw (TikaException)exception;
                throw new TikaException(exception.getMessage());
            }
        }
View Full Code Here

                    new CloseShieldInputStream(stream),
                    new OfflineContentHandler(new EmbeddedContentHandler(
                            getContentHandler(tagged, metadata, context))));
        } catch (SAXException e) {
            tagged.throwIfCauseOf(e);
            throw new TikaException("XML parse error", e);
        }

        xhtml.endElement("p");
        xhtml.endDocument();
    }
View Full Code Here

        if (converter != null) {
            try {
                xmp = converter.process( tikaMetadata );
            }
            catch (XMPException e) {
                throw new TikaException( "Tika metadata could not be converted to XMP", e );
            }
        }
        else {
            xmp = XMPMetaFactory.create(); // empty packet
        }
View Full Code Here

            if (clazz != null) {
                try {
                    converter = clazz.newInstance();
                }
                catch (Exception e) {
                    throw new TikaException(
                            "TikaToXMP converter class cannot be instantiated for mimetype: "
                                    + type.toString(), e );
                }
            }
        }
View Full Code Here

            }
            xhtml.endElement("ul");

            xhtml.endDocument();
        } catch (FeedException e) {
            throw new TikaException("RSS parse error", e);
        }

    }
View Full Code Here

        ArchiveInputStream ais;
        try {
            ArchiveStreamFactory factory = new ArchiveStreamFactory();
            ais = factory.createArchiveInputStream(stream);
        } catch (ArchiveException e) {
            throw new TikaException("Unable to unpack document stream", e);
        }

        MediaType type = getMediaType(ais);
        if (!type.equals(MediaType.OCTET_STREAM)) {
            metadata.set(CONTENT_TYPE, type.toString());
View Full Code Here

               case ENCRYPTED:
                   // We can't do anything for the file right now
                   contentHandler = null;
                   break;
               default:
                  throw new TikaException("Unhandled iWorks file " + type);
               }

               metadata.add(Metadata.CONTENT_TYPE, type.getType().toString());
               xhtml.startDocument();
               if (contentHandler != null) {
View Full Code Here

            // Any already registered namespace is not registered again
            try {
                registry.registerNamespace( namespace.uri, namespace.prefix );
            }
            catch (XMPException e) {
                throw new TikaException(
                        "Namespace needed by converter could not be registiered with XMPCore", e );
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tika.exception.TikaException

Copyright © 2018 www.massapicom. 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.