org.apache.webdav.lib.methods
Class RebindMethod
public class RebindMethod
The REBIND method removes a binding to a resource from one collection,
and adds a binding to that resource into another collection. It is
effectively an atomic form of a MOVE request.
REBIND Method Example:
>> Request:
REBIND /CollX HTTP/1.1
Host: www.example.com
Content-Type: text/xml; charset="utf-8"
Content-Length: xxx
<?xml version="1.0" encoding="utf-8" ?>
foo.html
http://www.example.com/CollY/bar.html
>> Response:
HTTP/1.1 200 OK
The server added a new binding to the collection,
"http://www.example.com/CollX", associating "foo.html" with the resource
identified by the URI "http://www.example.com/CollY/bar.html",
and removes the binding named "bar.html" from the collection identified
by the URI "http://www.example.com/CollY".
Clients can now use the URI "http://www.example.com/CollX/foo.html" to
submit requests to that resource, and requests on the URI
"http://www.example.com/CollY/bar.html" will fail with a 404 (Not Found)
response.
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
RebindMethod
public RebindMethod()
Method constructor.
RebindMethod
public RebindMethod(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 rebound
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 rebound
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