Search in sources :

Example 1 with ProfileCsvIoHandler

use of org.n52.io.handler.profile.ProfileCsvIoHandler in project series-rest-api by 52North.

the class ProfileIoFactory method createHandler.

@Override
public IoHandler<Data<ProfileValue<?>>> createHandler(String outputMimeType) {
    IoParameters parameters = getParameters();
    Constants.MimeType mimeType = Constants.MimeType.toInstance(outputMimeType);
    if (mimeType == Constants.MimeType.APPLICATION_ZIP || mimeType == Constants.MimeType.TEXT_CSV) {
        ProfileCsvIoHandler handler = new ProfileCsvIoHandler(parameters, createProcessChain(), getMetadatas());
        boolean zipOutput = parameters.getAsBoolean(Parameters.ZIP, false);
        handler.setZipOutput(zipOutput || mimeType == Constants.MimeType.APPLICATION_ZIP);
        return handler;
    }
    String msg = "The requested media type '" + outputMimeType + "' is not supported.";
    IllegalArgumentException exception = new IllegalArgumentException(msg);
    throw exception;
}
Also used : Constants(org.n52.io.Constants) IoParameters(org.n52.io.request.IoParameters) ProfileCsvIoHandler(org.n52.io.handler.profile.ProfileCsvIoHandler)

Aggregations

Constants (org.n52.io.Constants)1 ProfileCsvIoHandler (org.n52.io.handler.profile.ProfileCsvIoHandler)1 IoParameters (org.n52.io.request.IoParameters)1