com.clouway.friendlyserve.RsWithBody Maven / Gradle / Ivy
package com.clouway.friendlyserve;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collections;
import java.util.Map;
/**
* @author Miroslav Genov ([email protected])
*/
public class RsWithBody extends RsWrap {
public RsWithBody(InputStream in) {
this(new RsEmpty(), in);
}
public RsWithBody(final Response response, final InputStream body) {
super(new Response() {
@Override
public Iterable cookies() {
return Collections.emptyList();
}
@Override
public Status status() {
return response.status();
}
@Override
public Map header() throws IOException {
return response.header();
}
@Override
public InputStream body() throws IOException {
return body;
}
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy