org.apache.webdav.lib.methods
Class BindMethod
The BIND method modifies the collection identified by the Request-URI,
by adding a new binding from the segment specified in the BIND body
to the resource identified in the BIND body.
BIND Method Example:
>> Request:
BIND /CollY HTTP/1.1
Host: www.example.com
Content-Type: text/xml; charset="utf-8"
Content-Length: xxx
<?xml version="1.0" encoding="utf-8" ?>
bar.html
http://www.example.com/CollX/foo.html
>> Response:
HTTP/1.1 201 Created
The server added a new binding to the collection, "http://www.example.com/CollY",
associating "bar.html" with the resource identified by the URI
"http://www.example.com/CollX/foo.html". Clients can now use the URI
"http://www.example.com/CollY/bar.html", to submit requests to that resource.
void | addRequestHeaders(HttpState state, HttpConnection conn) - Generate additional headers needed by the request.
|
protected String | generateRequestBody() - DAV requests that contain a body must override this function to
generate that body.
|
String | getHref()
|
String | getName()
|
String | getSegment()
|
boolean | isOverwrite() - By default, if there already is a binding for the specified segment
in the collection, the new binding replaces the existing binding.
|
void | setHref(String href)
|
void | setOverwrite(boolean overwrite) - By default, if there already is a binding for the specified segment
in the collection, the new binding replaces the existing binding.
|
void | setSegment(String segment)
|
convertElementToProperty , generateRequestBody , getDebug , getRequestContentLength , getResponseDocument , getResponseHashtable , getResponseURLs , getResponses , parseResponse , parseXMLResponse , readResponseBody , recycle , setDebug , setDecodeResponseHrefs , setDocument , setResponseHashtable , writeRequestBody |
NAME
public static final String NAME
BindMethod
public BindMethod()
Method constructor.
BindMethod
public BindMethod(String existingBinding,
String newBinding)
addRequestHeaders
public void addRequestHeaders(HttpState state,
HttpConnection conn)
throws IOException,
HttpException
Generate additional headers needed by the request.
state
- HttpState tokenconn
- The connection being used for the request.
generateRequestBody
protected String generateRequestBody()
DAV requests that contain a body must override this function to
generate that body.
The default behavior simply returns an empty body.
- generateRequestBody in interface XMLResponseMethodBase
getHref
public String getHref()
- path of the resource to be bound
getName
public String getName()
getSegment
public String getSegment()
isOverwrite
public boolean isOverwrite()
By default, if there already is a binding for the specified segment
in the collection, the new binding replaces the existing binding.
This default binding replacement behavior can be overridden using
the Overwrite header.
- the current value of the overwrite flag
setHref
public void setHref(String href)
href
- path of the resource to be bound
setOverwrite
public void setOverwrite(boolean overwrite)
By default, if there already is a binding for the specified segment
in the collection, the new binding replaces the existing binding.
This default binding replacement behavior can be overridden using
the Overwrite header.
overwrite
- New overwrite value
setSegment
public void setSegment(String segment)
segment
- new resource name