|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jalios.jcms.webdav.WebdavFileSystem
public abstract class WebdavFileSystem
This class is an Abstract representation of a WebdavFileSystem. It's purpose is to handle all specific webdav concept and control before delegating to a a sub repository implementation doing more control and real commande.
Field Summary | |
---|---|
protected Map<String,Set<WebdavLock>> |
resourceLocks
|
static String |
REVISION
|
Constructor Summary | |
---|---|
protected |
WebdavFileSystem(WebdavContext ctxt)
Initialise the webdav FileSystem setting baseUri from ContextPath and ServletPath |
Method Summary | |
---|---|
void |
afterDoDelete(WebdavResource resource,
WebdavContext ctxt)
Must be called by Sub Implementation to resolve properties and locks problem. |
void |
afterDoMove(WebdavResource source,
WebdavResource target,
boolean overwrite,
boolean recursive,
WebdavContext ctxt)
Must be called by Sub Implementation to resolve properties and locks problem. |
boolean |
doCopy(WebdavResource source,
WebdavResource target,
boolean overwrite,
boolean recursive,
WebdavContext ctxt)
This method perform copy from one Webdav Resource to an Other |
abstract boolean |
doCreate(WebdavResource resource,
boolean overwrite,
boolean isFolder,
WebdavContext ctxt)
This method perform create from one Webdav Resource |
boolean |
doDelete(WebdavResource resource,
boolean recursive,
WebdavContext ctxt)
This method perform delete from one Webdav Resource |
WebdavLock |
doLock(WebdavResource resource,
WebdavContext ctxt)
This method will parse header to identify and create lock or locks on the given resource If Errors append or Lock only need a refresh then return false otherwise return true. |
boolean |
doMove(WebdavResource source,
WebdavResource target,
boolean overwrite,
boolean recursive,
WebdavContext ctxt)
This method perform move from one Webdav Resource to an Other |
boolean |
doPut(WebdavResource resource,
boolean overwrite,
WebdavContext ctxt)
This method will do a create/overwrite a File or a Folder |
boolean |
doUnlock(WebdavResource resource,
WebdavContext ctxt)
This method will unlock the given resource lock defined in the if header. |
String |
getAbsoluteUri(String path,
WebdavContext ctxt)
This method will convert a relative path to an absolute uri ie /my/folder/resource.ext -> http://www.example.com/jcms/webapp/webdav/my/folder/resource.ext |
Collection<WebdavLock> |
getDescendantLocks(WebdavResource resource,
WebdavContext ctxt)
This method will return locks of descendant on the given resource |
Collection<WebdavLock> |
getLocks(WebdavResource resource,
WebdavContext ctxt)
This method will return all locks on the given resource and on all the parent collection. |
String |
getRelativeUri(String uri,
WebdavContext ctxt)
This method will convert an absolute uri to a relative uri. |
abstract WebdavResource |
getResource(String uri,
WebdavContext ctxt)
Lookup the resource represented by the given URI. |
boolean |
hasInternalLock(WebdavResource res,
WebdavContext ctxt)
This method is called for other mecanism outside of Webdav |
void |
init()
Called after authentication for each request. |
boolean |
isInternallyLocked(WebdavResource res,
WebdavContext ctxt)
This method is called for other mecanism outside of Webdav |
boolean |
isListing(WebdavContext ctxt)
This method check if the FileSystem allow listing. |
boolean |
isReadOnly(WebdavContext ctxt)
Check if the FileSystem is ReadOnly. |
boolean |
matchesIfHeaderCondition(WebdavContext ctxt)
Check that the current resource matches the if header condition if any. |
abstract WebdavLock |
newLock(WebdavResource resource,
WebdavContext ctxt)
This method will return a new WebdavLock implementation |
String |
normalize(String path)
Return a context-relative path, beginning with a "/", that represents the canonical version of the specified path after ".." and "." elements are resolved out. |
WebdavLock |
putLock(WebdavLock lock,
WebdavResource resource,
WebdavContext ctxt)
This method will put a lock on single given resource |
WebdavLock |
putLocks(WebdavLock lock,
WebdavResource resource,
WebdavContext ctxt)
This method will put a lock on the given resource and its children |
WebdavLock |
refreshLock(WebdavResource resource,
WebdavContext ctxt)
This method will refresh a lock on the given resource and returned the refreshed lock if any or null otherwise. |
boolean |
removeLock(WebdavLock lock,
WebdavResource resource,
WebdavContext ctxt)
This method will remove tokens on the given resource and its children If there is no more tokens then remove the lock. |
boolean |
removeLocks(WebdavResource resource,
WebdavContext ctxt)
This method will remove all lock for a given resource and its children (shared lock will also be removed) |
protected boolean |
silentFilterResource(WebdavResource resource,
WebdavContext ctxt)
Return true if the resource should be silently ignored. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
protected Map<String,Set<WebdavLock>> resourceLocks
Constructor Detail |
---|
protected WebdavFileSystem(WebdavContext ctxt)
ctxt
- the Webdav ContextMethod Detail |
---|
public void init()
public boolean isReadOnly(WebdavContext ctxt)
ctxt
- the Webdav Context
public boolean isListing(WebdavContext ctxt)
ctxt
- the Webdav Context
public String getRelativeUri(String uri, WebdavContext ctxt)
Examples :
uri
- the absolute urictxt
- the Webdav Context
public String getAbsoluteUri(String path, WebdavContext ctxt)
path
- the path to convert to absolutectxt
- the Webdav Context
public String normalize(String path)
null
instead. If path starts with
http:// then clean behaviour to let http://
path
- Path to be normalized
public abstract WebdavResource getResource(String uri, WebdavContext ctxt)
uri
- the resource URIctxt
- the Webdav Context
public boolean doCopy(WebdavResource source, WebdavResource target, boolean overwrite, boolean recursive, WebdavContext ctxt)
source
- a Webdav Resourcetarget
- a Webdav Resourceoverwrite
- a boolean indicate to overite or not the resourcerecursive
- is it a recursive copyctxt
- the Webdav Context
public boolean doMove(WebdavResource source, WebdavResource target, boolean overwrite, boolean recursive, WebdavContext ctxt)
source
- a Webdav Resourcetarget
- a Webdav Resourceoverwrite
- a boolean indicate to overite or not the resourcerecursive
- is it a recursive copyctxt
- the Webdav Context
public void afterDoMove(WebdavResource source, WebdavResource target, boolean overwrite, boolean recursive, WebdavContext ctxt)
source
- the source WebdavResourcetarget
- the target WebdavResourceoverwrite
- a boolean indicate to overite or not the resourcerecursive
- is it a recursive copyctxt
- the Webdav Contextpublic abstract boolean doCreate(WebdavResource resource, boolean overwrite, boolean isFolder, WebdavContext ctxt)
resource
- the Webdav Resourceoverwrite
- a boolean indicate to ovewrite the resourceisFolder
- create a File or a Folderctxt
-
public boolean doDelete(WebdavResource resource, boolean recursive, WebdavContext ctxt)
resource
- the Webdav Resourcerecursive
- is it a recursive deletectxt
-
public void afterDoDelete(WebdavResource resource, WebdavContext ctxt)
resource
- the Webdav Resourcectxt
- the Webdav Contextpublic boolean doPut(WebdavResource resource, boolean overwrite, WebdavContext ctxt) throws javax.servlet.ServletException, IOException
resource
- the WebdavResourceoverwrite
- a boolean indicate to overite the resourcectxt
- the Webdav Context
javax.servlet.ServletException
IOException
public boolean matchesIfHeaderCondition(WebdavContext ctxt)
ctxt
- the current WebdavContext
protected boolean silentFilterResource(WebdavResource resource, WebdavContext ctxt)
resource
- the WebdavResourcectxt
- the WebdavContext
public WebdavLock doLock(WebdavResource resource, WebdavContext ctxt)
resource
- the WebdavResource to lockctxt
- the WebdavContext
public boolean doUnlock(WebdavResource resource, WebdavContext ctxt)
resource
- the WebdavResource to lockctxt
- the WebdavContext
public boolean hasInternalLock(WebdavResource res, WebdavContext ctxt)
res
- the WebdavResourcectxt
- the Webdav Context
public boolean isInternallyLocked(WebdavResource res, WebdavContext ctxt)
res
- the WebdavResourcectxt
- the Webdav Context
public abstract WebdavLock newLock(WebdavResource resource, WebdavContext ctxt)
resource
- the Webdav Resourcectxt
- the Webdav Context
public Collection<WebdavLock> getLocks(WebdavResource resource, WebdavContext ctxt)
resource
- the Webdav Resourcectxt
- the Webdav Context
public Collection<WebdavLock> getDescendantLocks(WebdavResource resource, WebdavContext ctxt)
resource
- the Webdav Resourcectxt
- the Webdav Context
public WebdavLock putLock(WebdavLock lock, WebdavResource resource, WebdavContext ctxt)
lock
- the WebdavLockresource
- the Webdav Resourcectxt
- the Webdav Context
public WebdavLock putLocks(WebdavLock lock, WebdavResource resource, WebdavContext ctxt)
lock
- the WebdavLockresource
- the Webdav Resourcectxt
- the Webdav Context
public boolean removeLock(WebdavLock lock, WebdavResource resource, WebdavContext ctxt)
lock
- the WebdavLockresource
- the Webdav Resourcectxt
- the Webdav Context
public boolean removeLocks(WebdavResource resource, WebdavContext ctxt)
resource
- the Webdav Resourcectxt
- the Webdav Context
public WebdavLock refreshLock(WebdavResource resource, WebdavContext ctxt)
resource
- the Webdav Resourcectxt
- the Webdav Context
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |