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

com.scarabsoft.jrest.converter.exception.StringExceptionConverter Maven / Gradle / Ivy

package com.scarabsoft.jrest.converter.exception;

import com.scarabsoft.jrest.util.IOUtils;

import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;

public class StringExceptionConverter implements ExceptionConverter {

    @Override
    public RuntimeException convert(InputStream stream) throws IOException {
        final String message = IOUtils.streamToString(stream);
        return new RuntimeException(message);
    }

    @Override
    public Collection convertCollection(InputStream inputStream, Class collectionClazz) throws IOException {
        throw new RuntimeException("not supported yet.");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy