| |
|
| java.lang.Object net.homeip.donaldm.httpdbase4j.Http
Http | public class Http (Code) | | Utility class providing various useful static methods
author: Donald Munro |
HTTP_CONTINUEHTTP_OKHTTP_REDIRECTHTTP_UNAUTHORISEDHTTP_FORBIDDENHTTP_NOTFOUNDHTTP_BADREQUESTHTTP_METHODHTTP_LENGTHHTTP_INTERNALERRORHTTP_NOTIMPLEMENTED | public static int HTTP_CONTINUEHTTP_OKHTTP_REDIRECTHTTP_UNAUTHORISEDHTTP_FORBIDDENHTTP_NOTFOUNDHTTP_BADREQUESTHTTP_METHODHTTP_LENGTHHTTP_INTERNALERRORHTTP_NOTIMPLEMENTED(Code) | | |
MIME_PLAINTEXTMIME_HTMLMIME_XMLMIME_BINARYMIME_ICON | final public static String MIME_PLAINTEXTMIME_HTMLMIME_XMLMIME_BINARYMIME_ICON(Code) | | |
eTag | public static String eTag(DirItemInterface... files)(Code) | | Calculate the e-tag for a list of files
Parameters: files - List of files to calculate e-tag for A String containing the e-tag. |
getErrorMessage | public static String getErrorMessage(int code)(Code) | | Maps a HTTP error code onto an error description.
Parameters: code - The HTTP error code An error description. |
getExtension | public static String getExtension(File file)(Code) | | Parameters: file - File to get the file extension for. The file extention |
getMimeType | public static String getMimeType(Request r)(Code) | | Parameters: r - Request instance for which to look up the MIME type The mime type |
readStream | public static int readStream(InputStream is, byte[] data, int len) throws IOException(Code) | | Read a stream in a byte array.
Parameters: is - - The stream to read Parameters: data - - The byte array into which to read the data.If null the array will be allocated Parameters: len - - The number of bytes to read A count of the bytes read. throws: IOException - |
readWriteStream | public static long readWriteStream(InputStream is, OutputStream os) throws IOException(Code) | | Copy an input stream to an output stream
Parameters: is - - The input stream Parameters: os - - The output stream The number of bytes copied throws: IOException - |
strExchange | protected static String strExchange(HttpExchange ex)(Code) | | Create a String representation of an HttpExchange object.
Parameters: ex - The HttpExchange object. A String representation of ex. |
|
|
|