org.apache.maven.wagon.providers.webdav

Class CorrectedWebdavResource


public class CorrectedWebdavResource
extends WebdavResource

Corrected Webdav Resource. This extension to the WebdavResource object corrects a Content-Length bug in the WebdavLib.
Author:
Joakim Erdfelt

Constructor Summary

CorrectedWebdavResource(HttpURL url)

Method Summary

void
addRequestHeader(String header, String value)
Add a header in the request sent to the webdav server
protected void
generateAdditionalHeaders(HttpMethod method)
Add all additionals headers that have been previously registered with addRequestHeader to the method
Map
getHeaders()
InputStream
getMethodData(String path)
Get InputStream for the GET method for the given path.
boolean
putMethod(String path, InputStream inputStream, int contentLength)
Execute the PUT method for the given path.
void
setHeaders(Map headers)

Constructor Details

CorrectedWebdavResource

public CorrectedWebdavResource(HttpURL url)
            throws IOException

Method Details

addRequestHeader

public void addRequestHeader(String header,
                             String value)
Add a header in the request sent to the webdav server
Parameters:
header - Header name
value - Value

generateAdditionalHeaders

protected void generateAdditionalHeaders(HttpMethod method)
Add all additionals headers that have been previously registered with addRequestHeader to the method

getHeaders

public Map getHeaders()

getMethodData

public InputStream getMethodData(String path)
            throws IOException
Get InputStream for the GET method for the given path.
Parameters:
path - the server relative path of the resource to get
Returns:
InputStream

putMethod

public boolean putMethod(String path,
                         InputStream inputStream,
                         int contentLength)
            throws IOException
Execute the PUT method for the given path.
Parameters:
path - the server relative path to put the data
inputStream - The input stream.
Returns:
true if the method is succeeded.

setHeaders

public void setHeaders(Map headers)