All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cloudconvert.processor.content.DataExtractingContentPreProcessor Maven / Gradle / Ivy

Go to download

CloudConvert is an online file converter API - more than 200 different audio, video, document, ebook, archive, image, spreadsheet and presentation formats supported.

There is a newer version: 1.2.1
Show newest version
package com.cloudconvert.processor.content;

import java.io.IOException;
import java.io.InputStream;

public class DataExtractingContentPreProcessor implements ContentPreProcessor {

    private static final String DATA = "data";

    private final DefaultContentPreProcessor defaultContentPreProcessor;

    public DataExtractingContentPreProcessor() {
        this.defaultContentPreProcessor = new DefaultContentPreProcessor();
    }

    @Override
    public String preProcess(final InputStream inputStream) throws IOException {
        final String rawString = defaultContentPreProcessor.preProcess(inputStream);

        // Get rid of "data" part
        return rawString.substring(8, rawString.length() - 1);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy