forked from mirror/BlueMap
Suppress some compile warnings
The resource can not be closed at this point, it will be closed later so we ignore the warning.
This commit is contained in:
parent
b6c0d64d62
commit
cf74a70f32
@ -80,6 +80,7 @@ public HttpResponse handle(HttpRequest request) {
|
||||
return response;
|
||||
}
|
||||
|
||||
@SuppressWarnings ("resource")
|
||||
private HttpResponse generateResponse(HttpRequest request) {
|
||||
String adress = request.getPath();
|
||||
if (adress.isEmpty()) adress = "/";
|
||||
|
@ -25,6 +25,7 @@
|
||||
package de.bluecolored.bluemap.core.webserver;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
@ -39,7 +40,7 @@
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
public class HttpResponse {
|
||||
public class HttpResponse implements Closeable {
|
||||
|
||||
private String version;
|
||||
private HttpStatusCode statusCode;
|
||||
@ -112,6 +113,11 @@ public void write(OutputStream out) throws IOException {
|
||||
data.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
data.close();
|
||||
}
|
||||
|
||||
private void writeLine(OutputStreamWriter writer, String line) throws IOException {
|
||||
writer.write(line + "\r\n");
|
||||
|
Loading…
Reference in New Issue
Block a user