Package io.milton.http
Interface Request
public interface Request
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumstatic enumstatic enumstatic enum -
Method Summary
Modifier and TypeMethodDescriptionReturn the path portion of the url.Return the complete URL, including protocol, host and port (if specified) and pathGet the user-agents preferred languages.Return a writable map of arbitrary values to be associated with the requestUsed for partial PUTsThis is used to acquire a cookie using the name of that cookie.This is used to acquire all cookies that were sent in the header.intgetFiles()Note to implementors: the parameters will be created by the core handler classes and added to the attributes map.equivalent to Servlet Request getRemoteHost Returns the fully qualified name of the client or the last proxy that sent the request.Use the Accept-Language header to derive a java LocaleUsed for MOVE and COPY methods.Note to implementors: the parameters will be created by the core handler classes and added to the attributes map.Returns the IP of the remote client.getRequestHeader(Request.Header header) voidvoidsetAuthorization(Auth auth) Maybe called by the milton framework after successful non-http authentication
-
Method Details
-
getHeaders
-
getFromAddress
String getFromAddress()equivalent to Servlet Request getRemoteHost Returns the fully qualified name of the client or the last proxy that sent the request.- Returns:
-
getLockTokenHeader
String getLockTokenHeader() -
getRequestHeader
-
getMethod
Request.Method getMethod() -
getAuthorization
Auth getAuthorization() -
setAuthorization
Maybe called by the milton framework after successful non-http authentication- Parameters:
auth- - the new auth object
-
getRefererHeader
String getRefererHeader() -
getTimeoutHeader
String getTimeoutHeader() -
getIfHeader
String getIfHeader() -
getIfRangeHeader
String getIfRangeHeader() -
getIfMatchHeader
String getIfMatchHeader() -
getIfNoneMatchHeader
String getIfNoneMatchHeader() -
getIfModifiedHeader
Date getIfModifiedHeader() -
getDepthHeader
int getDepthHeader() -
getAbsoluteUrl
String getAbsoluteUrl()Return the complete URL, including protocol, host and port (if specified) and path -
getAbsolutePath
String getAbsolutePath()Return the path portion of the url. This is everything following the host and port. Will always begin with a leading slash -
getHostHeader
String getHostHeader() -
getDestinationHeader
String getDestinationHeader() -
getExpectHeader
String getExpectHeader() -
getInputStream
- Throws:
IOException
-
parseRequestParameters
void parseRequestParameters(Map<String, String> params, Map<String, throws RequestParseExceptionFileItem> files) - Throws:
RequestParseException
-
getContentTypeHeader
String getContentTypeHeader() -
getContentLengthHeader
Long getContentLengthHeader() -
getAcceptHeader
String getAcceptHeader() -
getAcceptEncodingHeader
String getAcceptEncodingHeader() -
getAcceptLanguage
String getAcceptLanguage()Get the user-agents preferred languages. Eg: en-ca,en;q=0.8,en-us;q=0.6,de-de;q=0.4,de;q=0.2- Returns:
-
getRangeHeader
String getRangeHeader()- Returns:
- a range header, for partial gets
-
getContentRangeHeader
String getContentRangeHeader()Used for partial PUTs- Returns:
-
getOverwriteHeader
Boolean getOverwriteHeader()Used for MOVE and COPY methods. If true it indicates that any existing resource should be deleted before the move.- Returns:
- - null if no value, true indicates that any existing resource should be deleted
-
getOriginHeader
String getOriginHeader() -
getUserAgentHeader
String getUserAgentHeader()- Returns:
- - the user agent header field
-
getAttributes
Return a writable map of arbitrary values to be associated with the request- Returns:
- a writable map of arbitrary values to be associated with the request
-
getParams
Note to implementors: the parameters will be created by the core handler classes and added to the attributes map. If you're extending AbstractRequest this method will already be implemented for you by returning that attribute If you are not extending AbstractRequest you should implement this as: return attributes.get( "_params");- Returns:
- - map of querystring or POST parameters, keyed by name
-
getFiles
Note to implementors: the parameters will be created by the core handler classes and added to the attributes map. If you're extending AbstractRequest this method will already be implemented for you by returning that attribute If you are not extending AbstractRequest you should return implement this as: return attributes.get( "_files");- Returns:
- - a map of files from an upload request, keyed by file name
-
getCookie
This is used to acquire a cookie using the name of that cookie. If the cookie exists within the HTTP header then it is returned as aCookieobject. Otherwise this method will return null. Each cookie object will contain the name, value and path of the cookie as well as the optional domain part.- Parameters:
name- this is the name of the cookie object to acquire- Returns:
- this returns a cookie object from the header or null
-
getCookies
This is used to acquire all cookies that were sent in the header. If any cookies exists within the HTTP header they are returned asCookieobjects. Otherwise this method will an empty list. Each cookie object will contain the name, value and path of the cookie as well as the optional domain part.- Returns:
- this returns all cookie objects from the HTTP header
-
getRemoteAddr
String getRemoteAddr()Returns the IP of the remote client. This attempts to find the originating client, ie not the last proxy, by using X-Forwarded-For etc- Returns:
-
getLocale
Locale getLocale()Use the Accept-Language header to derive a java Locale- Returns:
-