smbdav
Interface Property

All Known Implementing Classes:
AbstractProperty

public interface Property

Represents a WebDAV property. This provides an interface for retrieving and updating properties of resources.

Author:
Eric Glass

Field Summary
static java.lang.String DAV_NAMESPACE
          The WebDAV namespace URI, "DAV:".
static java.lang.String WEB_FOLDERS_NAMESPACE
          The Web Folders attribute namespace URI, "urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/".
static java.lang.String XMLNS_NAMESPACE
          The XMLNS namespace URI, "http://www.w3.org/2000/xmlns/".
 
Method Summary
 org.w3c.dom.Element createElement(org.w3c.dom.Document document, jcifs.smb.SmbFile file)
          Creates a property element for the given resource (if applicable), with the specified document as the owner.
 void destroy()
          Disposes of the property.
 boolean equals(java.lang.Object obj)
          Indicates whether an Object is equivalent to this Property object.
 java.lang.String getName()
          Returns the property name.
 java.lang.String getNamespace()
          Returns the namespace URI of the property.
 java.lang.String getPrefix()
          Returns the prefix used when creating elements for this property.
 int hashCode()
          Returns the hash code for this property.
 void init(java.lang.String name, javax.servlet.ServletConfig config)
          Initilizes the property and identifies it with the provided name.
 int retrieve(jcifs.smb.SmbFile file, org.w3c.dom.Element element)
          Populates the provided Element with the current value of the property for the given resource.
 int update(jcifs.smb.SmbFile file, org.w3c.dom.Element element)
          Updates this property on the given resource using the information int the specified element.
 

Field Detail

XMLNS_NAMESPACE

public static final java.lang.String XMLNS_NAMESPACE
The XMLNS namespace URI, "http://www.w3.org/2000/xmlns/".

See Also:
Constant Field Values

DAV_NAMESPACE

public static final java.lang.String DAV_NAMESPACE
The WebDAV namespace URI, "DAV:".

See Also:
Constant Field Values

WEB_FOLDERS_NAMESPACE

public static final java.lang.String WEB_FOLDERS_NAMESPACE
The Web Folders attribute namespace URI, "urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/".

See Also:
Constant Field Values
Method Detail

init

public void init(java.lang.String name,
                 javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Initilizes the property and identifies it with the provided name.

Parameters:
name - The name by which the property will be identified.
config - The servlet configuration object containing initialization information for the property.
Throws:
javax.servlet.ServletException - If the property could not be initialized.

destroy

public void destroy()
Disposes of the property.


getName

public java.lang.String getName()
Returns the property name.

Returns:
A String containing the name of the property. This will be the local name of the element in the XML document.

getNamespace

public java.lang.String getNamespace()
Returns the namespace URI of the property.

Returns:
A String containing the namespace URI in which the property resides.

getPrefix

public java.lang.String getPrefix()
Returns the prefix used when creating elements for this property. If the namespace URI for this property already has a prefix associated with it, the existing prefix will be used.

Returns:
A String containing the prefix applied to elements created by this property.

createElement

public org.w3c.dom.Element createElement(org.w3c.dom.Document document,
                                         jcifs.smb.SmbFile file)
                                  throws java.io.IOException
Creates a property element for the given resource (if applicable), with the specified document as the owner. The element will not be added to the document. The document may be modified, however, to apply namespace attributes or otherwise prepare the document to receive the element in the future.

Parameters:
document - The document that is to own the property element.
file - The resource being queried.
Returns:
An Element for the property. If this property does not apply to the specified resource, null will be returned.
Throws:
java.io.IOException - If an IO error occurs while creating the element.

update

public int update(jcifs.smb.SmbFile file,
                  org.w3c.dom.Element element)
           throws java.io.IOException
Updates this property on the given resource using the information int the specified element.

Parameters:
file - The resource that is to be updated.
element - The element containing the update information.
Returns:
An int containing the HTTP response code. For a successful update, this will be HttpServletResponse.SC_OK.
Throws:
java.io.IOException - If an IO error occurs while updating the property value.

equals

public boolean equals(java.lang.Object obj)
Indicates whether an Object is equivalent to this Property object. Two properties are equal if they reside in the same namespace and have the same name (regardless of prefix equivalence).

Parameters:
obj - The object to compare to this property
Returns:
A boolean indicating whether the given object is equivalent to this property.

hashCode

public int hashCode()
Returns the hash code for this property. The hash code for a property object is defined as the hash code of the property's name XORed with the hash code of the property's namespace.

Returns:
An int containing the hash code for the property.

retrieve

public int retrieve(jcifs.smb.SmbFile file,
                    org.w3c.dom.Element element)
             throws java.io.IOException
Populates the provided Element with the current value of the property for the given resource.

Parameters:
file - The resource whose property value is to be retrieved.
element - The element which receives the value.
Returns:
An int containing the HTTP response code. For a successful retrieval, this will be HttpServletResponse.SC_OK.
Throws:
java.io.IOException - If an IO error occurs while retrieving the property value.


Copyright © 2004 Eric Glass