Package org.apache.tika.embedder

Examples of org.apache.tika.embedder.Embedder


     * Tests embedding metadata then reading metadata to verify the results.
     *
     * @param isResultExpectedInOutput whether or not results are expected in command line output
     */
    protected void embedInTempFile(InputStream sourceInputStream, boolean isResultExpectedInOutput) {
        Embedder embedder = getEmbedder();
       
        // TODO Move this check to ExternalEmbedder
        String os = System.getProperty("os.name", "");
        if (os.contains("Windows")) {
            // Skip test on Windows
            return;
        }
       
        Date timestamp = new Date();
        Metadata metadataToEmbed = getMetadataToEmbed(timestamp);

        try {
            File tempOutputFile = tmp.createTemporaryFile();
            FileOutputStream tempFileOutputStream = new FileOutputStream(tempOutputFile);

            // Embed the metadata into a copy of the original output stream
            embedder.embed(metadataToEmbed, sourceInputStream, tempFileOutputStream, null);

            ParseContext context = new ParseContext();
            Parser parser = getParser();
            context.set(Parser.class, parser);

View Full Code Here


     * @param isResultExpectedInOutput whether or not results are expected in command line output
     */
    protected void embedInTempFile(boolean isResultExpectedInOutput) {
        Date timestamp = new Date();
        Metadata metadataToEmbed = getMetadataToEmbed(timestamp);
        Embedder embedder = getEmbedder();

        try {
            // Get the input stream for the test document
            InputStream origInputStream = getOriginalInputStream();
            File tempOutputFile = tmp.createTemporaryFile();
            FileOutputStream tempFileOutputStream = new FileOutputStream(tempOutputFile);

            // Embed the metadata into a copy of the original output stream
            embedder.embed(metadataToEmbed, origInputStream, tempFileOutputStream, null);

            ParseContext context = new ParseContext();
            Parser parser = getParser();
            context.set(Parser.class, parser);

View Full Code Here

     * Tests embedding metadata then reading metadata to verify the results.
     *
     * @param isResultExpectedInOutput whether or not results are expected in command line output
     */
    protected void embedInTempFile(InputStream sourceInputStream, boolean isResultExpectedInOutput) {
        Embedder embedder = getEmbedder();
       
        // TODO Move this check to ExternalEmbedder
        String os = System.getProperty("os.name", "");
        if (os.contains("Windows")) {
            // Skip test on Windows
            return;
        }
       
        Date timestamp = new Date();
        Metadata metadataToEmbed = getMetadataToEmbed(timestamp);

        try {
            File tempOutputFile = tmp.createTemporaryFile();
            FileOutputStream tempFileOutputStream = new FileOutputStream(tempOutputFile);

            // Embed the metadata into a copy of the original output stream
            embedder.embed(metadataToEmbed, sourceInputStream, tempFileOutputStream, null);

            ParseContext context = new ParseContext();
            Parser parser = getParser();
            context.set(Parser.class, parser);

View Full Code Here

TOP

Related Classes of org.apache.tika.embedder.Embedder

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.