diff options
author | Daniel Erat <derat@google.com> | 2016-01-04 12:00:55 -0700 |
---|---|---|
committer | Daniel Erat <derat@google.com> | 2016-01-04 13:13:11 -0700 |
commit | 12973d7c220d261c3748e3c8051b3ef478cf5b7a (patch) | |
tree | a2280c142a8e82ff6c3c5b11a4a118d3b4ba81ab /core/src/main/java | |
parent | 2ebd55e1bd837f6ae9e7c6c5ab003ea47991e876 (diff) | |
download | nanohttpd-12973d7c220d261c3748e3c8051b3ef478cf5b7a.tar.gz |
Add newFixedLengthResponse() to the NanoHTTPD class.
This method replaces Response's public constructor in
v2.2.0. To avoid temporary breakage, I'm adding an
implementation of it so that existing callers can be updated
to call it before NanoHTTPD is rolled forward.
Bug: 26289868
Change-Id: If68a314f16294e226b223cb35b6c35ca7449a03d
Diffstat (limited to 'core/src/main/java')
-rw-r--r-- | core/src/main/java/fi/iki/elonen/NanoHTTPD.java | 9 |
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/> |