com.bradmcevoy.http
Interface Request

All Known Implementing Classes:
AbstractRequest, DebugFilter.DebugRequest

public interface Request


Nested Class Summary
static class Request.CacheControlRequest
           
static class Request.Depth
           
static class Request.Header
           
static class Request.Method
           
 
Method Summary
 java.lang.String getAbsolutePath()
          Return the path portion of the url.
 java.lang.String getAbsoluteUrl()
          Return the complete URL, including protocol, host and port (if specified) and path
 java.lang.String getAcceptEncodingHeader()
           
 java.lang.String getAcceptHeader()
           
 java.util.Map<java.lang.String,java.lang.Object> getAttributes()
          Return a writable map of arbitrary values to be associated with the request
 Auth getAuthorization()
           
 java.lang.Long getContentLengthHeader()
           
 java.lang.String getContentRangeHeader()
          Used for partial PUTs
 java.lang.String getContentTypeHeader()
           
 Cookie getCookie(java.lang.String name)
          This is used to acquire a cookie using the name of that cookie.
 java.util.List<Cookie> getCookies()
          This is used to acquire all cookies that were sent in the header.
 int getDepthHeader()
           
 java.lang.String getDestinationHeader()
           
 java.lang.String getExpectHeader()
           
 java.util.Map<java.lang.String,FileItem> getFiles()
          Note to implementors: the parameters will be created by the core handler classes and added to the attributes map.
 java.lang.String getFromAddress()
           
 java.util.Map<java.lang.String,java.lang.String> getHeaders()
           
 java.lang.String getHostHeader()
           
 java.lang.String getIfHeader()
           
 java.util.Date getIfModifiedHeader()
           
 java.io.InputStream getInputStream()
           
 java.lang.String getLockTokenHeader()
           
 Request.Method getMethod()
           
 java.lang.Boolean getOverwriteHeader()
          Used for MOVE and COPY methods.
 java.util.Map<java.lang.String,java.lang.String> getParams()
          Note to implementors: the parameters will be created by the core handler classes and added to the attributes map.
 java.lang.String getRangeHeader()
           
 java.lang.String getRefererHeader()
           
 java.lang.String getRemoteAddr()
          Returns the IP of the remote client
 java.lang.String getRequestHeader(Request.Header header)
           
 java.lang.String getTimeoutHeader()
           
 java.lang.String getUserAgentHeader()
           
 void parseRequestParameters(java.util.Map<java.lang.String,java.lang.String> params, java.util.Map<java.lang.String,FileItem> files)
           
 void setAuthorization(Auth auth)
          Maybe called by the milton framework after successful non-http authentication
 

Method Detail

getHeaders

java.util.Map<java.lang.String,java.lang.String> getHeaders()

getFromAddress

java.lang.String getFromAddress()

getLockTokenHeader

java.lang.String getLockTokenHeader()

getRequestHeader

java.lang.String getRequestHeader(Request.Header header)

getMethod

Request.Method getMethod()

getAuthorization

Auth getAuthorization()

setAuthorization

void setAuthorization(Auth auth)
Maybe called by the milton framework after successful non-http authentication

Parameters:
auth - - the new auth object

getRefererHeader

java.lang.String getRefererHeader()

getTimeoutHeader

java.lang.String getTimeoutHeader()

getIfHeader

java.lang.String getIfHeader()

getIfModifiedHeader

java.util.Date getIfModifiedHeader()

getDepthHeader

int getDepthHeader()

getAbsoluteUrl

java.lang.String getAbsoluteUrl()
Return the complete URL, including protocol, host and port (if specified) and path


getAbsolutePath

java.lang.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

java.lang.String getHostHeader()

getDestinationHeader

java.lang.String getDestinationHeader()

getExpectHeader

java.lang.String getExpectHeader()

getInputStream

java.io.InputStream getInputStream()
                                   throws java.io.IOException
Throws:
java.io.IOException

parseRequestParameters

void parseRequestParameters(java.util.Map<java.lang.String,java.lang.String> params,
                            java.util.Map<java.lang.String,FileItem> files)
                            throws RequestParseException
Throws:
RequestParseException

getContentTypeHeader

java.lang.String getContentTypeHeader()

getContentLengthHeader

java.lang.Long getContentLengthHeader()

getAcceptHeader

java.lang.String getAcceptHeader()

getAcceptEncodingHeader

java.lang.String getAcceptEncodingHeader()

getRangeHeader

java.lang.String getRangeHeader()
Returns:
a range header, for partial gets

getContentRangeHeader

java.lang.String getContentRangeHeader()
Used for partial PUTs

Returns:

getOverwriteHeader

java.lang.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

getUserAgentHeader

java.lang.String getUserAgentHeader()
Returns:
- the user agent header field

getAttributes

java.util.Map<java.lang.String,java.lang.Object> 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

java.util.Map<java.lang.String,java.lang.String> 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

java.util.Map<java.lang.String,FileItem> 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

Cookie getCookie(java.lang.String name)
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 a Cookie object. 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

java.util.List<Cookie> 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 as Cookie objects. 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

java.lang.String getRemoteAddr()
Returns the IP of the remote client

Returns:


Copyright © 2011. All Rights Reserved.