org.apache.webdav.lib

Class 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) Hashtable
hrefTable
The resources for each href and its properties.

Constructor Summary

WebdavResources()
Default constuctor.
WebdavResources(WebdavResource resource)
This constuctor.

Method Summary

void
addResource(String resourceName, WebdavResource resource)
Maps the resource name to its resource.
void
addResource(WebdavResource resource)
Add the specified resource.
WebdavResource
getResource(String resourceName)
Get an resource.
Enumeration
getResourceNames()
Get an enumeration of the resource names.
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(String resourceName)
Test if there is a resource called the specified resource name.
String[]
list()
Get an array of resource names.
WebdavResource[]
listResources()
Get an arraay of resources.
void
removeAll()
Remove all resources.
WebdavResource
removeResource(String resourceName)
Remove the specified resource name.
String
toString()
Return the string for this class.

Field Details

hrefTable

(package private)  Hashtable hrefTable
The resources for each href and its properties.

Constructor Details

WebdavResources

public WebdavResources()
Default constuctor.

WebdavResources

public WebdavResources(WebdavResource resource)
This constuctor.
Parameters:
resource - A resource to add.

Method Details

addResource

public void addResource(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.

addResource

public void addResource(WebdavResource resource)
Add the specified resource.
Parameters:
resource - The resource to add.

getResource

public WebdavResource getResource(String resourceName)
Get an resource.
Parameters:
resourceName - The resource name.
Returns:
The wanted resource if it exists.

getResourceNames

public Enumeration getResourceNames()
Get an enumeration of the resource names.
Returns:
An enumeration of the resource names.

getResources

public Enumeration getResources()
Get an enumeration of the resources.
Returns:
An enumeration of resources.

isEmpty

public boolean isEmpty()
Test if there is no resource.
Returns:
true if it's empty.

isThereResource

public boolean isThereResource(WebdavResource resource)
Test if there is a resource.
Parameters:
resource - The specified resource.
Returns:
true if it exists.

isThereResourceName

public boolean isThereResourceName(String resourceName)
Test if there is a resource called the specified resource name.
Parameters:
resourceName - The resource name to check.

list

public 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.

removeAll

public void removeAll()
Remove all resources.

removeResource

public WebdavResource removeResource(String resourceName)
Remove the specified resource name.
Parameters:
resourceName - The specified resource name.
Returns:
The wanted resource.

toString

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