pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.webdav
Interface DAVStore

All Known Implementing Classes:
VFSDAVStore

public interface DAVStore

This interface has to be implemented when writing a data-store to be used in conjunction with the DAVServlet.

Version:
$Revision: 1431 $
Author:
Thomas Weber

Method Summary
 boolean addDeadProperty(java.net.URI uri, User user, DeadProperty prop)
          sets a dead property for the object identified by the given URI.
 boolean canRead(java.net.URI resourceURI, User user)
          checks whether the given user has read access to the specified URI.
 boolean canWrite(java.net.URI resourceURI, User user)
          checks whether the given user has write access to the specified URI.
 void copy(java.net.URI sourceURI, java.net.URI destinationURI, User user, MultiStatusResponse res)
          performs a recursive copy command.
 boolean createResourceCollection(java.net.URI uri, User user)
          creates a new resource collection at the given URI.
 java.net.URI enforceTailingSlash(java.net.URI uri)
          enforces a tailing slash (needed for collection URIs).
 java.lang.String getCharacterEncoding(java.net.URI resourceURI, User user)
          returns the character encoding of the resource URI.
 java.util.Collection<java.net.URI> getChildren(java.net.URI uri, User user)
          returns the children of the collection identified by the given URI.
 java.io.InputStream getContent(java.net.URI uri, User user)
          returns an input stream for the resource identified by the given URI.
 long getContentLength(java.net.URI uri, User user)
          returns the content-length of the resource identified by the given URI.
 java.lang.String getContentType(java.net.URI resourceURI, User user)
          returns the content-type associated with the URI.
 long getCreationDate(java.net.URI uri, User user)
          returns the creation date of the object identified by the given URI.
 org.jdom.Content getDAVProperty(java.net.URI uri, User user, DAVProperties prop)
          returns the requested DAV property the object identified by the given URI.
 java.util.Collection<? extends DeadProperty> getDeadProperties()
          returns all known dead properties.
 java.util.Collection<DeadProperty> getDeadProperties(java.net.URI uri)
          returns all known dead properties for the given URI.
 DeadProperty getDeadProperty(java.net.URI uri, User user, DeadProperty prop)
          returns the requested dead property for the object identified by the given URI.
 java.lang.String getETag(java.net.URI uri)
          returns the ETag of the object identified by the given URI.
 long getLastModified(java.net.URI uri, User user)
          returns the last modification date of the object identified by the given URI.
 java.net.URI getParentURI(java.net.URI resourceURI)
          returns the URI of the parent or the URI itself, if it denotes the root.
 boolean isCollection(java.net.URI uri)
          returns whether the given URI specifies a collection.
 boolean isResource(java.net.URI uri)
          returns whether the given URI specifies a resource.
 void move(java.net.URI sourceURI, java.net.URI destinationURI, User user, MultiStatusResponse res)
          performs a recursive move command.
 boolean objectExists(java.net.URI uri)
          returns whether the given URI exists.
 void removeObject(java.net.URI uri, User user)
          deletes a single object.
 void setContent(java.net.URI uri, User user, java.io.InputStream content, java.lang.String contentType, java.lang.String characterEncoding, HttpDAVServletResponse res)
          sets the content of a resource and optionally creates it, if it does not exist yet.
 java.net.URI translateDavURI(java.lang.String uri)
          translates a DAV URI.
 java.net.URI translateStoreURI(java.net.URI uri)
          translates a store URI.
 

Method Detail

enforceTailingSlash

java.net.URI enforceTailingSlash(java.net.URI uri)
enforces a tailing slash (needed for collection URIs).

Parameters:
uri - the URI
Returns:
the URI with a guaranteed slash at the end

translateDavURI

java.net.URI translateDavURI(java.lang.String uri)
translates a DAV URI.

Parameters:
uri - the DAV URI
Returns:
the store URI

translateStoreURI

java.net.URI translateStoreURI(java.net.URI uri)
translates a store URI.

Parameters:
uri - the store URI
Returns:
the DAV URI

canRead

boolean canRead(java.net.URI resourceURI, User user)
checks whether the given user has read access to the specified URI.

Parameters:
resourceURI - the URI
user - the user
Returns:
true, if the user has read access. Otherwise false.

canWrite

boolean canWrite(java.net.URI resourceURI, User user)
checks whether the given user has write access to the specified URI.

If the given URI does not exist yet, the store checks whether the user has write access to the parent collection.

Parameters:
resourceURI - the URI
user - the user
Returns:
true, if the user has write access. Otherwise false.

createResourceCollection

boolean createResourceCollection(java.net.URI uri, User user)
creates a new resource collection at the given URI.

Parameters:
uri - the URI
user - the user
Returns:
true, if the collection has been successfully created

getChildren

java.util.Collection<java.net.URI> getChildren(java.net.URI uri, User user)
returns the children of the collection identified by the given URI.

Parameters:
uri - the URI
user - the user
Returns:
the child objects

getContent

java.io.InputStream getContent(java.net.URI uri, User user)
                               throws java.io.IOException
returns an input stream for the resource identified by the given URI.

Parameters:
uri - the URI
user - the user
Returns:
the input stream
Throws:
java.io.IOException - on errors accessing the object

getContentLength

long getContentLength(java.net.URI uri, User user)
returns the content-length of the resource identified by the given URI.

Parameters:
uri - the URI
user - the user
Returns:
the content length

getCreationDate

long getCreationDate(java.net.URI uri, User user)
returns the creation date of the object identified by the given URI.

Parameters:
uri - the URI
user - the user
Returns:
the content length

getLastModified

long getLastModified(java.net.URI uri, User user)
                     throws java.io.IOException
returns the last modification date of the object identified by the given URI.

Parameters:
uri - the URI
user - the user
Returns:
the content length
Throws:
java.io.IOException - on errors

getETag

java.lang.String getETag(java.net.URI uri)
returns the ETag of the object identified by the given URI.

Parameters:
uri - the URI
Returns:
the content length

addDeadProperty

boolean addDeadProperty(java.net.URI uri, User user, DeadProperty prop)
                        throws java.io.IOException
sets a dead property for the object identified by the given URI.

Parameters:
uri - the URI
user - the user
prop - the property to set
Returns:
true, if and only if the property has been set. Otherwise false.
Throws:
java.io.IOException - on errors accessing the object

getDAVProperty

org.jdom.Content getDAVProperty(java.net.URI uri, User user, DAVProperties prop)
                                throws java.io.IOException
returns the requested DAV property the object identified by the given URI.

Parameters:
uri - the URI
user - the user
prop - the requested property
Returns:
the content length
Throws:
java.io.IOException - on errors accessing the object

getDeadProperty

DeadProperty getDeadProperty(java.net.URI uri, User user, DeadProperty prop)
                             throws java.io.IOException
returns the requested dead property for the object identified by the given URI.

Parameters:
uri - the URI
user - the user
prop - the prototype of the requested property
Returns:
the requested dead property or null, if no such property exists
Throws:
java.io.IOException - on errors accessing the object

getDeadProperties

java.util.Collection<DeadProperty> getDeadProperties(java.net.URI uri)
returns all known dead properties for the given URI.

Parameters:
uri - the URI
Returns:
all known dead properties

getDeadProperties

java.util.Collection<? extends DeadProperty> getDeadProperties()
returns all known dead properties.

Returns:
all known dead properties

isCollection

boolean isCollection(java.net.URI uri)
returns whether the given URI specifies a collection.

Parameters:
uri - the URI
Returns:
true, if the resource exists. Otherwise false.

isResource

boolean isResource(java.net.URI uri)
returns whether the given URI specifies a resource.

Parameters:
uri - the URI
Returns:
true, if the URI exists. Otherwise false.

objectExists

boolean objectExists(java.net.URI uri)
returns whether the given URI exists.

Parameters:
uri - the URI
Returns:
true, if the URI exists. Otherwise false.

setContent

void setContent(java.net.URI uri, User user,
                java.io.InputStream content,
                java.lang.String contentType,
                java.lang.String characterEncoding, HttpDAVServletResponse res)
                throws java.io.IOException
sets the content of a resource and optionally creates it, if it does not exist yet.

Parameters:
uri - the URI
user - the user
content - the input stream
contentType - the content type specified by the client
characterEncoding - the character encoding specified by the client
res - for early sending of DAVStatus.CREATED (may be null)
Throws:
java.io.IOException - on errors

getContentType

java.lang.String getContentType(java.net.URI resourceURI, User user)
returns the content-type associated with the URI.

Parameters:
resourceURI - the URI
user - the user
Returns:
the content-type

getCharacterEncoding

java.lang.String getCharacterEncoding(java.net.URI resourceURI, User user)
returns the character encoding of the resource URI.

Parameters:
resourceURI - the URI
user - the user
Returns:
the character encoding or null, if no encoding is known

move

void move(java.net.URI sourceURI,
          java.net.URI destinationURI, User user, MultiStatusResponse res)
          throws java.io.IOException
performs a recursive move command.

Parameters:
sourceURI - the source URI
destinationURI - the destination URI
user - the user
res - the multi-status response
Throws:
java.io.IOException - on errors

copy

void copy(java.net.URI sourceURI,
          java.net.URI destinationURI, User user, MultiStatusResponse res)
          throws java.io.IOException
performs a recursive copy command.

Parameters:
sourceURI - the source URI
destinationURI - the destination URI
user - the user
res - the multi-status response
Throws:
java.io.IOException - on errors

removeObject

void removeObject(java.net.URI uri, User user)
                  throws java.io.IOException
deletes a single object.

Parameters:
uri - the URI
user - the user
Throws:
java.io.IOException - on errors removing the object

getParentURI

java.net.URI getParentURI(java.net.URI resourceURI)
returns the URI of the parent or the URI itself, if it denotes the root.

Parameters:
resourceURI - the URI
Returns:
the parent