|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.xml_project.morganaxproc.filesystem.XProcHttpRequest
public class XProcHttpRequest
This class contains the data for a http request found in p:http-request.
Nested Class Summary | |
---|---|
static class |
XProcHttpRequest.AuthenticationMethods
|
Constructor Summary | |
---|---|
XProcHttpRequest(java.net.URI uri,
java.lang.String method)
Constructs a new XProcHttpRequest with an uri and a method. |
Method Summary | |
---|---|
void |
addBody(HttpBody body)
Adds a body to this request |
void |
addHeader(HttpHeader header)
Adds a header to this request. |
void |
addHeaders(nu.xom.Elements headers)
Adds headers to the request from a list of XOM elements. |
XProcHttpRequest.AuthenticationMethods |
getAuthMethod()
Returns the authorization method associated with this request. |
static XProcHttpRequest.AuthenticationMethods |
getAuthMethod(java.lang.String text)
Static factory method for Authentication Methods |
HttpBody[] |
getBodies()
Returns the bodies set for this request. |
java.lang.String |
getBoundary()
Returns the mime boundary associated with this request |
java.lang.String |
getContentType()
Return the value of the header 'content-type' or an empty string, if the header is no set. |
java.lang.String[] |
getCredentials()
Returns the credentials as a string array (user name|password) if they were set for this request. |
java.lang.String |
getHeader(java.lang.String headername)
Return the value set for the header with the given name. |
HttpHeader[] |
getHeaders()
Returns the headers set for this request. |
java.lang.String |
getMethod()
Returns the method associated with this request. |
java.net.URI |
getURI()
Return the uri associated with this request. |
boolean |
isMultipart()
Returns whether this is a multipart request or not. |
boolean |
sendAuthentication()
Returns whether credentials should be sent unrequested. |
void |
setAuthentication(java.lang.String username,
java.lang.String password,
XProcHttpRequest.AuthenticationMethods authMethod,
boolean sendAuthentication)
Sets the authentication credentials for this request. |
void |
setBoundary(java.lang.String boundary)
Sets the mime boundary to be used. |
void |
setMultipart()
Flags this request to be multipart. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XProcHttpRequest(java.net.URI uri, java.lang.String method)
XProcHttpRequest
with an uri and a method.
uri
- a uri made from 'href' found in c:request.method
- the method as found in c:requestMethod Detail |
---|
public void setAuthentication(java.lang.String username, java.lang.String password, XProcHttpRequest.AuthenticationMethods authMethod, boolean sendAuthentication)
username
- the user name (may be null) as found in c:requestpassword
- the password (may be null) as found in c:requestauthMethod
- the authentication method (may be null) as found in c:requestsendAuthentication
- determines if credentials should be send unrequested as found in c:request.public boolean sendAuthentication()
true
if credentials should be sent unrequested.public XProcHttpRequest.AuthenticationMethods getAuthMethod()
public java.lang.String[] getCredentials()
public java.lang.String getMethod()
public java.lang.String getBoundary()
public java.net.URI getURI()
public boolean isMultipart()
true
if this is a multipart request, false
otherwise.public void setMultipart()
public void setBoundary(java.lang.String boundary)
boundary
- the boundary to be used or null.public void addHeader(HttpHeader header)
header
- the header to add.public void addHeaders(nu.xom.Elements headers)
headers
- the XOM elements with the headers.public void addBody(HttpBody body)
body
- the body to add.public HttpHeader[] getHeaders()
public HttpBody[] getBodies()
public java.lang.String getHeader(java.lang.String headername)
headername
- the name of the header to look for.
public java.lang.String getContentType()
public static XProcHttpRequest.AuthenticationMethods getAuthMethod(java.lang.String text)
text
- the method's name or null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |