public class MaryHttpServerUtils extends Object
Constructor and Description |
---|
MaryHttpServerUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
errorFileNotFound(org.apache.http.HttpResponse response,
String uri) |
static void |
errorInternalServerError(org.apache.http.HttpResponse response,
String message,
Throwable exception) |
static void |
errorMissingQueryParameter(org.apache.http.HttpResponse response,
String param) |
static void |
errorWrongQueryParameterValue(org.apache.http.HttpResponse response,
String paramName,
String illegalValue,
String explanation) |
static void |
fileToHttpResponse(String fullPathFile,
org.apache.http.HttpResponse response,
String contentType,
boolean useFileChannels) |
static String |
getMimeType(AudioFileFormat.Type audioType) |
static void |
toHttpResponse(byte[] byteArray,
org.apache.http.HttpResponse response,
String contentType) |
static void |
toHttpResponse(double[] x,
org.apache.http.HttpResponse response,
String contentType) |
static void |
toHttpResponse(InputStream stream,
org.apache.http.HttpResponse response,
String contentType) |
static void |
toHttpResponse(InputStream stream,
org.apache.http.HttpResponse response,
String contentType,
long streamLength) |
static void |
toHttpResponse(int[] x,
org.apache.http.HttpResponse response,
String contentType) |
static void |
toHttpResponse(String x,
org.apache.http.HttpResponse response,
String contentType) |
static Map<String,String> |
toKeyValuePairs(String httpString,
boolean performUrlDecode)
Convert HTTP request string into key-value pairs
|
public static void toHttpResponse(double[] x, org.apache.http.HttpResponse response, String contentType) throws IOException
IOException
public static void toHttpResponse(int[] x, org.apache.http.HttpResponse response, String contentType) throws IOException
IOException
public static void toHttpResponse(String x, org.apache.http.HttpResponse response, String contentType) throws IOException
IOException
public static void toHttpResponse(byte[] byteArray, org.apache.http.HttpResponse response, String contentType) throws IOException
IOException
public static void toHttpResponse(InputStream stream, org.apache.http.HttpResponse response, String contentType) throws IOException
IOException
public static void toHttpResponse(InputStream stream, org.apache.http.HttpResponse response, String contentType, long streamLength) throws IOException
IOException
public static void fileToHttpResponse(String fullPathFile, org.apache.http.HttpResponse response, String contentType, boolean useFileChannels)
public static Map<String,String> toKeyValuePairs(String httpString, boolean performUrlDecode)
httpString
- the query part of the http request urlperformUrlDecode
- whether to URL-decode the keys and valuespublic static String getMimeType(AudioFileFormat.Type audioType)
public static void errorFileNotFound(org.apache.http.HttpResponse response, String uri)
public static void errorInternalServerError(org.apache.http.HttpResponse response, String message, Throwable exception)
public static void errorMissingQueryParameter(org.apache.http.HttpResponse response, String param)
Copyright © 2000–2016 DFKI GmbH. All rights reserved.