org.apache.webdav.lib
Class WebdavResources

java.lang.Object
  extended byorg.apache.webdav.lib.WebdavResources

public class WebdavResources
extends java.lang.Object

This WebdavResources class represents a set of WebDAV resources . Two WebdavResource instances are considered equal, if there getName() method returns the same string.


Field Summary
(package private)  java.util.Hashtable hrefTable
          The resources for each href and its properties.
 
Constructor Summary
WebdavResources()
          Default constuctor.
WebdavResources(WebdavResource resource)
          This constuctor.
 
Method Summary
 void addResource(java.lang.String resourceName, WebdavResource resource)
          Maps the resource name to its resource.
 void addResource(WebdavResource resource)
          Add the specified resource.
 WebdavResource getResource(java.lang.String resourceName)
          Get an resource.
 java.util.Enumeration getResourceNames()
          Get an enumeration of the resource names.
 java.util.Enumeration getResources()
          Get an enumeration of the resources.
 boolean isEmpty()
          Test if there is no resource.
 boolean isThereResource(WebdavResource resource)
          Test if there is a resource.
 boolean isThereResourceName(java.lang.String resourceName)
          Test if there is a resource called the specified resource name.
 java.lang.String[] list()
          Get an array of resource names.
 WebdavResource[] listResources()
          Get an arraay of resources.
 void removeAll()
          Remove all resources.
 WebdavResource removeResource(java.lang.String resourceName)
          Remove the specified resource name.
 java.lang.String toString()
          Return the string for this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

hrefTable

java.util.Hashtable hrefTable
The resources for each href and its properties.

Constructor Detail

WebdavResources

public WebdavResources()
Default constuctor.


WebdavResources

public WebdavResources(WebdavResource resource)
This constuctor.

Parameters:
resource - A resource to add.
Method Detail

isEmpty

public boolean isEmpty()
Test if there is no resource.

Returns:
true if it's empty.

isThereResourceName

public boolean isThereResourceName(java.lang.String resourceName)
Test if there is a resource called the specified resource name.

Parameters:
resourceName - The resource name to check.

isThereResource

public boolean isThereResource(WebdavResource resource)
Test if there is a resource.

Parameters:
resource - The specified resource.
Returns:
true if it exists.

getResourceNames

public java.util.Enumeration getResourceNames()
Get an enumeration of the resource names.

Returns:
An enumeration of the resource names.

getResources

public java.util.Enumeration getResources()
Get an enumeration of the resources.

Returns:
An enumeration of resources.

list

public java.lang.String[] list()
Get an array of resource names.

Returns:
An array of resource names.

listResources

public WebdavResource[] listResources()
Get an arraay of resources.

Returns:
An array of resources.

getResource

public WebdavResource getResource(java.lang.String resourceName)
Get an resource.

Parameters:
resourceName - The resource name.
Returns:
The wanted resource if it exists.

addResource

public void addResource(java.lang.String resourceName,
                        WebdavResource resource)
Maps the resource name to its resource. The resource name could be different from the displayname property. It's useful for representing itself or parent collection.

Parameters:
resourceName - The resource name.
resource - The resource.
See Also:
addResource(WebdavResource)

addResource

public void addResource(WebdavResource resource)
Add the specified resource.

Parameters:
resource - The resource to add.

removeResource

public WebdavResource removeResource(java.lang.String resourceName)
Remove the specified resource name.

Parameters:
resourceName - The specified resource name.
Returns:
The wanted resource.

removeAll

public void removeAll()
Remove all resources.


toString

public java.lang.String toString()
Return the string for this class.