public class WebDavStore extends Object implements WebDavStore
WebDavStore.MoveResourceStatus, WebDavStore.PutResourceStatus
Modifier and Type | Field and Description |
---|---|
protected javax.jdo.PersistenceManagerFactory |
pmf |
Constructor and Description |
---|
WebDavStore(javax.jdo.PersistenceManagerFactory pmf) |
Modifier and Type | Method and Description |
---|---|
RequestContext |
begin(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Indicates that a new request or transaction with this store involved has
been started.
|
void |
commit(RequestContext requestContext)
Indicates that all changes done inside this request shall be made
permanent and any transactions, connections and other temporary resources
shall be terminated.
|
void |
createCollection(RequestContext requestContext,
String path)
Creates a folder at the position specified by
folderUri . |
Collection<Resource> |
getChildren(RequestContext requestContext,
Resource res)
Gets the names of the children of the folder specified by
folderUri . |
List<Lock> |
getLocksByPath(RequestContext requestContext,
String path)
Gets the LockedObject on specified path.
|
String |
getMimeType(Resource res)
Gets mime type of stored object.
|
protected String |
getParentPath(String path) |
static javax.jdo.PersistenceManager |
getPersistenceManager(javax.servlet.http.HttpServletRequest req,
javax.jdo.PersistenceManagerFactory pmf) |
Resource |
getResourceByPath(RequestContext requestContext,
String path)
Path is of the form:
{provider.id} "/" {segment.id} ["/user/"] {user.id} ["/profile/"] {profile.name} "/" {feed.name} ["/" {folder.name} ]* "/" {document.name}
|
org.w3c.cci2.BinaryLargeObject |
getResourceContent(RequestContext requestContext,
Resource res)
Gets the content of the resource specified by
resourceUri . |
Lock |
lock(RequestContext requestContext,
String path,
String owner,
String scope,
String type,
int depth,
int timeout)
Tries to lock the resource at "path".
|
WebDavStore.MoveResourceStatus |
moveResource(RequestContext requestContext,
Resource sourceRes,
String sourcePath,
String destinationPath)
Moves the resource from sourcePath to destinationPath
|
WebDavStore.PutResourceStatus |
putResource(RequestContext requestContext,
String path,
InputStream content,
String contentType) |
void |
removeResource(RequestContext requestContext,
Resource res)
Removes the object specified by
uri . |
void |
rollback(RequestContext requestContext)
Indicates that all changes done inside this request shall be undone and
any transactions, connections and other temporary resources shall be
terminated.
|
void |
setLockTimeout(RequestContext requestContext,
String id,
int timeout)
Set timeout for specified lock.
|
boolean |
unlock(RequestContext requestContext,
String id)
Unlocks all resources at "path" (and all subfolders if existing) that
have the same owner.
|
public WebDavStore(javax.jdo.PersistenceManagerFactory pmf)
pmf
- public static javax.jdo.PersistenceManager getPersistenceManager(javax.servlet.http.HttpServletRequest req, javax.jdo.PersistenceManagerFactory pmf)
req
- pmf
- public RequestContext begin(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
WebDavStore
WebDavStore.commit(RequestContext transaction)
or
WebDavStore.rollback(RequestContext transaction)
. If only non-read methods
have been called, the request will be terminated by a
WebDavStore.commit(RequestContext transaction)
. This method will be
called by (@link WebdavStoreAdapter} at the beginning of each request.begin
in interface WebDavStore
public void commit(RequestContext requestContext)
WebDavStore
commit
in interface WebDavStore
requestContext
- indicates that the method is within the scope of a WebDAV
transactionpublic void createCollection(RequestContext requestContext, String path)
WebDavStore
folderUri
.createCollection
in interface WebDavStore
requestContext
- indicates that the method is within the scope of a WebDAV
transactionpath
- URI of the folderpublic Collection<Resource> getChildren(RequestContext requestContext, Resource res)
WebDavStore
folderUri
.getChildren
in interface WebDavStore
requestContext
- indicates that the method is within the scope of a WebDAV
transactionpublic org.w3c.cci2.BinaryLargeObject getResourceContent(RequestContext requestContext, Resource res)
WebDavStore
resourceUri
.getResourceContent
in interface WebDavStore
requestContext
- indicates that the method is within the scope of a WebDAV
transactionpublic Resource getResourceByPath(RequestContext requestContext, String path)
getResourceByPath
in interface WebDavStore
requestContext
- indicates that the method is within the scope of a WebDAV
transactionpath
- URIpublic void removeResource(RequestContext requestContext, Resource res)
WebDavStore
uri
.removeResource
in interface WebDavStore
requestContext
- indicates that the method is within the scope of a WebDAV
transactionpublic WebDavStore.MoveResourceStatus moveResource(RequestContext requestContext, Resource sourceRes, String sourcePath, String destinationPath)
WebDavStore
moveResource
in interface WebDavStore
public void rollback(RequestContext requestContext)
WebDavStore
rollback
in interface WebDavStore
requestContext
- indicates that the method is within the scope of a WebDAV
transactionpublic String getMimeType(Resource res)
WebDavStore
getMimeType
in interface WebDavStore
public WebDavStore.PutResourceStatus putResource(RequestContext requestContext, String path, InputStream content, String contentType)
putResource
in interface WebDavStore
public List<Lock> getLocksByPath(RequestContext requestContext, String path)
WebDavStore
getLocksByPath
in interface WebDavStore
path
- Path to requested resourcepublic Lock lock(RequestContext requestContext, String path, String owner, String scope, String type, int depth, int timeout) throws LockFailedException
WebDavStore
lock
in interface WebDavStore
path
- what resource to lockowner
- the owner of the lockdepth
- depthtimeout
- Lock Duration in seconds.LockFailedException
public void setLockTimeout(RequestContext requestContext, String id, int timeout)
WebDavStore
setLockTimeout
in interface WebDavStore
public boolean unlock(RequestContext requestContext, String id)
WebDavStore
unlock
in interface WebDavStore
id
- id to the resource to unlockThis software is published under the BSD license. Copyright © 2003-${build.year}, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.