com.clouway.friendlyserve.RsEmpty Maven / Gradle / Ivy
package com.clouway.friendlyserve;
import com.google.common.collect.ImmutableMap;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.util.Collections;
import java.util.Map;
/**
* RsEmpty is a an empty response without headers and body.
*
* @author Miroslav Genov ([email protected])
*/
public class RsEmpty implements Response {
@Override
public Iterable cookies() {
return Collections.emptyList();
}
@Override
public Status status() {
return new Status(HttpURLConnection.HTTP_OK, "");
}
@Override
public Map header() throws IOException {
return ImmutableMap.of();
}
@Override
public InputStream body() throws IOException {
return new ByteArrayInputStream(new byte[0]);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy