aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Erat <derat@google.com>2016-01-04 21:44:58 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-01-04 21:44:58 +0000
commit48e7e363b22de734efa9ca2bdb0d02976a432918 (patch)
treec8ca3bcce72159a0fcf55a91bc2def3098d59322
parent82426238b3f467c82bece5e894220d893b8d0765 (diff)
parent12973d7c220d261c3748e3c8051b3ef478cf5b7a (diff)
downloadnanohttpd-48e7e363b22de734efa9ca2bdb0d02976a432918.tar.gz
Add newFixedLengthResponse() to the NanoHTTPD class.
am: 12973d7c22 * commit '12973d7c220d261c3748e3c8051b3ef478cf5b7a': Add newFixedLengthResponse() to the NanoHTTPD class.
-rw-r--r--core/src/main/java/fi/iki/elonen/NanoHTTPD.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/src/main/java/fi/iki/elonen/NanoHTTPD.java b/core/src/main/java/fi/iki/elonen/NanoHTTPD.java
index ed59670..73fea3c 100644
--- a/core/src/main/java/fi/iki/elonen/NanoHTTPD.java
+++ b/core/src/main/java/fi/iki/elonen/NanoHTTPD.java
@@ -254,6 +254,15 @@ public abstract class NanoHTTPD {
}
/**
+ * Create a response with known length.
+ *
+ * TODO: Remove this implementation when updating to v2.2.0.
+ */
+ public static Response newFixedLengthResponse(Response.Status status, String mimeType, String txt) {
+ return new Response(status, mimeType, txt);
+ }
+
+ /**
* Override this to customize the server.
* <p/>
* <p/>