org.apache.cocoon.components.webdav
Class WebDAVUtil

java.lang.Object
  extended by org.apache.cocoon.components.webdav.WebDAVUtil

public class WebDAVUtil
extends Object

A utility for WebDAV.


Constructor Summary
WebDAVUtil()
           
 
Method Summary
static void copyResource(String from, String to, boolean recurse, boolean overwrite)
          copy a WebDAV resource
static void createResource(String uri, String content)
          create a new resource on the server
static List getAllProperties(String uri)
          get all properties for given uri
static Map getProperties(String uri, Set propNames)
          get multiple properties
static SourceProperty getProperty(String uri, String name, String namespace)
          get a property
static org.apache.webdav.lib.WebdavResource getWebdavResource(String uri)
          instantiate a WebdavResource object from a given uri
static void makeCollection(String parent, String collection)
          create a collection
static void makePath(String path)
          make the complete path of a given collection URI (including all parent collections)
static void moveResource(String from, String to, boolean recurse, boolean overwrite)
          move a WebDAV resource
static void setProperties(String uri, Map properties)
          set multiple property
static void setProperty(String uri, String name, String namespace, String value)
          set a property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebDAVUtil

public WebDAVUtil()
Method Detail

getWebdavResource

public static org.apache.webdav.lib.WebdavResource getWebdavResource(String uri)
                                                              throws org.apache.commons.httpclient.HttpException,
                                                                     IOException
instantiate a WebdavResource object from a given uri

Parameters:
uri - the uri of the resource.
Throws:
org.apache.commons.httpclient.HttpException
IOException

createResource

public static void createResource(String uri,
                                  String content)
                           throws org.apache.commons.httpclient.HttpException,
                                  IOException
create a new resource on the server

Parameters:
uri - the uri of the resource.
content - the content to initialize the resource with.
Throws:
org.apache.commons.httpclient.HttpException
IOException

copyResource

public static void copyResource(String from,
                                String to,
                                boolean recurse,
                                boolean overwrite)
                         throws org.apache.commons.httpclient.HttpException,
                                IOException
copy a WebDAV resource

Parameters:
from - the URI of the resource to copy
to - the URI of the destination
overwrite - if true overwrites the destination
recurse - if true recursively creates parent collections if not existant
Throws:
org.apache.commons.httpclient.HttpException
IOException

moveResource

public static void moveResource(String from,
                                String to,
                                boolean recurse,
                                boolean overwrite)
                         throws org.apache.commons.httpclient.HttpException,
                                IOException
move a WebDAV resource

Parameters:
from - the URI of the resource to move
to - the URI of the destination
overwrite - if true overwrites the destination
recurse - if true recursively creates parent collections if not existant
Throws:
org.apache.commons.httpclient.HttpException
IOException

makePath

public static void makePath(String path)
                     throws org.apache.commons.httpclient.HttpException,
                            IOException
make the complete path of a given collection URI (including all parent collections)

Parameters:
path - the URI of the collection to make
Throws:
org.apache.commons.httpclient.HttpException
IOException

makeCollection

public static void makeCollection(String parent,
                                  String collection)
                           throws org.apache.commons.httpclient.HttpException,
                                  IOException
create a collection

Parameters:
parent - the uri of the parent collection
collection - the name of the collection to make
Throws:
org.apache.commons.httpclient.HttpException
IOException

getProperty

public static SourceProperty getProperty(String uri,
                                         String name,
                                         String namespace)
                                  throws org.apache.commons.httpclient.HttpException,
                                         IOException
get a property

Parameters:
uri - the URI to get the property from
name - the name of the property
namespace - the namespace of the property
Throws:
org.apache.commons.httpclient.HttpException
IOException

getProperties

public static Map getProperties(String uri,
                                Set propNames)
                         throws org.apache.commons.httpclient.HttpException,
                                IOException
get multiple properties

Parameters:
uri - the URI to get the properties from
propNames - the Set containing the properties to set
Throws:
org.apache.commons.httpclient.HttpException
IOException

getAllProperties

public static List getAllProperties(String uri)
                             throws org.apache.commons.httpclient.HttpException,
                                    IOException
get all properties for given uri

Parameters:
uri - the URI to get the properties from
Throws:
org.apache.commons.httpclient.HttpException
IOException

setProperty

public static void setProperty(String uri,
                               String name,
                               String namespace,
                               String value)
                        throws org.apache.commons.httpclient.HttpException,
                               IOException
set a property

Parameters:
uri - the URI of the resource to set the property on
name - the name of the property
namespace - the namespace of the property
value - the new value of the property
Throws:
org.apache.commons.httpclient.HttpException
IOException

setProperties

public static void setProperties(String uri,
                                 Map properties)
                          throws org.apache.commons.httpclient.HttpException,
                                 IOException
set multiple property

Parameters:
uri - the URI of the resource to set the property on
properties - the Map containing the property values to set
Throws:
org.apache.commons.httpclient.HttpException
IOException


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.