@Override
    public boolean processFileResource(FileResource fileResource) {

        ParseContext context = new ParseContext();
        if (parseRecursively) {
            context.set(Parser.class, parser);
        }

        OutputStream os = getOutputStream(fsOSFactory, fileResource);
        //os can be null if fsOSFactory is set to skip processing a file if the output
        //file already exists
        if (os == null) {
            LOG.debug("Skipping: {}", fileResource
                    .getMetadata()
                    .get(FSProperties.FS_REL_PATH));
            return false;
        }

        InputStream is = getInputStream(fileResource);
        if (is == null) {
            IOUtils.closeQuietly(os);
            return false;
        }
        ContentHandler handler;
        handler = contentHandlerFactory.getNewContentHandler(os, getOutputEncoding());


        //now actually call parse!
        Throwable thrown = null;
        try {
            parse(fileResource.getResourceId(), parser, is, handler, fileResource.getMetadata(), context);
        } catch (Error t) {
            throw t;
        } catch (Throwable t) {
            thrown = t;
        } finally {
            flushAndClose(os);
        }

        if (thrown != null) {
            return false;
        }
        return true;
    }
@param queue
@param parserFactory
@param contentHandlerFactory
@param fsOSFactory
@param tikaConfig
@deprecated use {@link BasicTikaFSConsumer#BasicTikaFSConsumer(ArrayBlockingQueue,
Parser, ContentHandlerFactory, OutputStreamFactory)}
tika-batch/src/main/java/org/apache/tika/batch/fs/BasicTikaFSConsumer.java