class SynchronousTransformer extends BatchRefineTransformer implements
        SyncTransformer {

    @Override
    public Entity transform(HttpRequestEntity entity) throws IOException {
        logMessage(entity.getRequest());

        final HttpRequestEntity request = cast(entity);

        final ImmutablePair<MimeType, Properties> options = exporterOptions(request);
        options.right.putAll(transformerConfig);
        final File input = downloadInput(entity);
        final File output = File.createTempFile("reply", "tmp");

        final ITransformEngine engine = getEngine();

        return new WritingEntity() {
            @Override
            public void writeData(OutputStream out) throws IOException {
                try {
                    // Can't allow more than one transform at a time as OpenRefine is not
                    // designed for that.
                    synchronized (SynchronousTransformer.this) {
                        engine.transform(input.toURI(), fetchTransform(request), output.toURI(),
                                options.right);
                    }

                    try (FileInputStream stream = new FileInputStream(output)) {
                        IOUtils.copy(stream, out);
                    }
                } finally {
                    input.delete();
                    output.delete();
                }
            }

            @Override
            public MimeType getType() {
                return options.left;
            }
        };
    }

    public  SynchronousTransformer(ITransformEngine engine, Properties config);

}