|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jalios.jcms.webdav.WebdavResource
public abstract class WebdavResource
This class is an Abstract Representation of a Webdav Resource doing all webdav specific task or delegating to WebdavFileSystem. It must be overrided by sub level Content Management Implementation.
Field Summary | |
---|---|
protected boolean |
possibleFile
|
static String |
REVISION
|
protected String |
uri
|
Constructor Summary | |
---|---|
protected |
WebdavResource(String uri,
WebdavContext ctxt)
The resource must be a relative URI to the path folders starting and ending by '/'. |
Method Summary | |
---|---|
boolean |
checkUnlockAccess(WebdavContext ctxt)
Check unlock access for current context on this resource |
int |
compareTo(WebdavResource otherRes)
|
boolean |
equals(Object obj)
|
abstract Collection<WebdavResource> |
getChildren(WebdavContext ctxt)
Return all the Children of the resource. |
String |
getContentLanguage(WebdavContext ctxt)
This method will return the content language Default implementation return null |
abstract long |
getContentLength(WebdavContext ctxt)
Return the size of the resource or 0 if there is no content |
abstract String |
getContentType(WebdavContext ctxt)
This method have to return the Content Type of the resource with the Content Encoding ie "text/html; charset=UTF-8" It is the media type defined in section 3.7 of [RFC2068] If no content type then return "" |
abstract long |
getCreationDate(WebdavContext ctxt)
Return long representing the Creation of the resource It contains a timestamp of the moment when the resource was created (i.e., the moment it had non-null state). |
Collection<WebdavLock> |
getDescendantLocks(WebdavContext ctxt)
Convenient method that delegate call to the WebdavFileSystem |
String |
getETag(boolean strong,
WebdavContext ctxt)
Return a etag representation usefull not to be read-only with ms-word |
long |
getLastAccessed(WebdavContext ctxt)
This method will return a long representing the last time this resource was accessed. |
abstract long |
getLastModified(WebdavContext ctxt)
Return long representing the LastModified of the resource Note that the last-modified date on a resource may reflect changes in any part of the state of the resource, not necessarily just a change to the response to the GET method. |
Collection<WebdavLock> |
getLocks(WebdavContext ctxt)
Convenient method that delegate call to the WebdavFileSystem |
String |
getName(WebdavContext ctxt)
This method will return the name of the resource ie /my/path/resource.ext -> resource.ext ie /my/path/ -> path |
WebdavResource |
getParent(WebdavContext ctxt)
This method will return the Parent WebdavResource of the resource. |
String |
getPath(WebdavContext ctxt)
This method will return the path of the resource ie /my/path/resource.ext -> /my/path/resource.ext ie /my/path/ -> /my/path/ |
abstract InputStream |
getResourceStream(WebdavContext ctxt)
This method have to return an InputStream on the resource. |
boolean |
hasExclusiveLockAccess(WebdavContext ctxt)
Check that current user has an exclusive lock access for current context on this resource |
boolean |
hasLockAccess(WebdavContext ctxt)
Check lock access for current context on this resource |
abstract boolean |
isExisting(WebdavContext ctxt)
Check if the resource exists in the UserFileSystem This method is abstract and must be implemented by the UserFileSystem. |
boolean |
isFile(WebdavContext ctxt)
This method will check if the resource is a File or a Folder. |
boolean |
isFolder(WebdavContext ctxt)
This method will check if the resource is a File or a Folder. |
boolean |
isHidden(WebdavContext ctxt)
This method will return true if the resource isHidden. |
boolean |
isPossibleFile()
|
boolean |
isReadable(boolean recursive,
WebdavContext ctxt)
This method will return true if the resource can be read by the context. |
boolean |
isWritable(boolean recursive,
boolean overwrite,
WebdavContext ctxt)
This method will return true if the resource can be write by the context. |
WebdavLock |
putLock(WebdavLock lock,
WebdavContext ctxt)
Convenient method that delegate call to the WebdavFileSystem |
WebdavLock |
putLocks(WebdavLock lock,
WebdavContext ctxt)
Convenient method that delegate call to the WebdavFileSystem |
void |
setPath(String uri,
WebdavContext ctxt)
|
void |
setPossibleContent(boolean isFile)
Used by creation method to define the content may be a File or a Folder. |
abstract boolean |
setResourceStream(InputStream in,
WebdavContext ctxt)
This method have to return an InputStream on the resource. |
String |
toString()
Override the toString() method |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
protected String uri
protected boolean possibleFile
Constructor Detail |
---|
protected WebdavResource(String uri, WebdavContext ctxt)
uri
- the resource urictxt
- the Webdav ContextWebdavFileSystem.getResource(String, WebdavContext)
Method Detail |
---|
public Collection<WebdavLock> getLocks(WebdavContext ctxt)
ctxt
- the Webdav Context
public Collection<WebdavLock> getDescendantLocks(WebdavContext ctxt)
ctxt
- the Webdav Context
public WebdavLock putLock(WebdavLock lock, WebdavContext ctxt)
lock
- the Webdav Lockctxt
- the Webdav Context
public WebdavLock putLocks(WebdavLock lock, WebdavContext ctxt)
lock
- the Webdav Lockctxt
- the Webdav Context
public boolean hasExclusiveLockAccess(WebdavContext ctxt)
ctxt
- the WebdavContext
public boolean hasLockAccess(WebdavContext ctxt)
ctxt
- the WebdavContext
public boolean checkUnlockAccess(WebdavContext ctxt)
ctxt
- the WebdavContext
public String getETag(boolean strong, WebdavContext ctxt)
strong
- indicate the way to get the etagctxt
- the Webdav Context
public String getName(WebdavContext ctxt)
ctxt
- the Webdav Context
public String getPath(WebdavContext ctxt)
ctxt
- the Webdav Context
public void setPath(String uri, WebdavContext ctxt)
public String toString()
toString
in class Object
public void setPossibleContent(boolean isFile)
isFile
- Content may be a filepublic boolean isPossibleFile()
public boolean isFolder(WebdavContext ctxt)
ctxt
- the Webdav Context
public boolean isFile(WebdavContext ctxt)
ctxt
- the Webdav Context
public WebdavResource getParent(WebdavContext ctxt)
ctxt
- the Webdav Context
public boolean isReadable(boolean recursive, WebdavContext ctxt)
recursive
- Check if children are also readablectxt
- the Webdav Context
public boolean isWritable(boolean recursive, boolean overwrite, WebdavContext ctxt)
recursive
- Check if children are also writableoverwrite
- Inform that resources will be overwrited if existsctxt
- the Webdav Context
public boolean isHidden(WebdavContext ctxt)
ctxt
- the Webdav Context
public long getLastAccessed(WebdavContext ctxt)
ctxt
- the Webdav Context
public String getContentLanguage(WebdavContext ctxt)
ctxt
- the Webdav Context
public abstract Collection<WebdavResource> getChildren(WebdavContext ctxt)
ctxt
- the Webdav Context
public abstract boolean isExisting(WebdavContext ctxt)
ctxt
- the Webdav Context
public abstract long getContentLength(WebdavContext ctxt)
ctxt
- the Webdav Context
public abstract long getCreationDate(WebdavContext ctxt)
ctxt
- the Webdav Context
public abstract long getLastModified(WebdavContext ctxt)
ctxt
- the Webdav Context
public abstract InputStream getResourceStream(WebdavContext ctxt) throws IOException
ctxt
- the Webdav Context
IOException
public abstract boolean setResourceStream(InputStream in, WebdavContext ctxt) throws IOException
in
- the Request InputStreamctxt
- the Webdav Context
IOException
public abstract String getContentType(WebdavContext ctxt)
ctxt
- the Webdav Context
public int compareTo(WebdavResource otherRes)
compareTo
in interface Comparable<WebdavResource>
public boolean equals(Object obj)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |