public abstract class WebdavResource extends java.lang.Object implements java.lang.Comparable<WebdavResource>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
possibleFile |
static java.lang.String |
REVISION |
protected java.lang.String |
uri |
| Modifier | Constructor and Description |
|---|---|
protected |
WebdavResource(java.lang.String uri,
WebdavContext ctxt)
The resource must be a relative URI to the path folders starting and ending by '/'.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkUnlockAccess(WebdavContext ctxt)
Check unlock access for current context on this resource
|
int |
compareTo(WebdavResource otherRes) |
boolean |
equals(java.lang.Object obj) |
abstract java.util.Collection<WebdavResource> |
getChildren(WebdavContext ctxt)
Return all the Children of the resource.
|
java.lang.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 java.lang.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).
|
java.util.Collection<WebdavLock> |
getDescendantLocks(WebdavContext ctxt)
Convenient method that delegate call to the WebdavFileSystem
|
java.lang.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.
|
java.util.Collection<WebdavLock> |
getLocks(WebdavContext ctxt)
Convenient method that delegate call to the WebdavFileSystem
|
java.lang.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.
|
java.lang.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 java.io.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(java.lang.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(java.io.InputStream in,
WebdavContext ctxt)
This method have to return an InputStream on the resource.
|
java.lang.String |
toString()
Override the toString() method
|
public static final java.lang.String REVISION
protected java.lang.String uri
protected boolean possibleFile
protected WebdavResource(java.lang.String uri,
WebdavContext ctxt)
uri - the resource urictxt - the Webdav ContextWebdavFileSystem.getResource(String, WebdavContext)public java.util.Collection<WebdavLock> getLocks(WebdavContext ctxt)
ctxt - the Webdav Contextpublic java.util.Collection<WebdavLock> getDescendantLocks(WebdavContext ctxt)
ctxt - the Webdav Contextpublic WebdavLock putLock(WebdavLock lock, WebdavContext ctxt)
lock - the Webdav Lockctxt - the Webdav Contextpublic WebdavLock putLocks(WebdavLock lock, WebdavContext ctxt)
lock - the Webdav Lockctxt - the Webdav Contextpublic boolean hasExclusiveLockAccess(WebdavContext ctxt)
ctxt - the WebdavContextpublic boolean hasLockAccess(WebdavContext ctxt)
ctxt - the WebdavContextpublic boolean checkUnlockAccess(WebdavContext ctxt)
ctxt - the WebdavContextpublic java.lang.String getETag(boolean strong,
WebdavContext ctxt)
strong - indicate the way to get the etagctxt - the Webdav Contextpublic java.lang.String getName(WebdavContext ctxt)
ctxt - the Webdav Contextpublic java.lang.String getPath(WebdavContext ctxt)
ctxt - the Webdav Contextpublic void setPath(java.lang.String uri,
WebdavContext ctxt)
public java.lang.String toString()
toString in class java.lang.Objectpublic void setPossibleContent(boolean isFile)
isFile - Content may be a filepublic boolean isPossibleFile()
public boolean isFolder(WebdavContext ctxt)
ctxt - the Webdav Contextpublic boolean isFile(WebdavContext ctxt)
ctxt - the Webdav Contextpublic WebdavResource getParent(WebdavContext ctxt)
ctxt - the Webdav Contextpublic boolean isReadable(boolean recursive,
WebdavContext ctxt)
recursive - Check if children are also readablectxt - the Webdav Contextpublic 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 Contextpublic boolean isHidden(WebdavContext ctxt)
ctxt - the Webdav Contextpublic long getLastAccessed(WebdavContext ctxt)
ctxt - the Webdav Contextpublic java.lang.String getContentLanguage(WebdavContext ctxt)
ctxt - the Webdav Contextpublic abstract java.util.Collection<WebdavResource> getChildren(WebdavContext ctxt)
ctxt - the Webdav Contextpublic abstract boolean isExisting(WebdavContext ctxt)
ctxt - the Webdav Contextpublic abstract long getContentLength(WebdavContext ctxt)
ctxt - the Webdav Contextpublic abstract long getCreationDate(WebdavContext ctxt)
ctxt - the Webdav Contextpublic abstract long getLastModified(WebdavContext ctxt)
ctxt - the Webdav Contextpublic abstract java.io.InputStream getResourceStream(WebdavContext ctxt) throws java.io.IOException
ctxt - the Webdav Contextjava.io.IOExceptionpublic abstract boolean setResourceStream(java.io.InputStream in,
WebdavContext ctxt)
throws java.io.IOException
in - the Request InputStreamctxt - the Webdav Contextjava.io.IOExceptionpublic abstract java.lang.String getContentType(WebdavContext ctxt)
ctxt - the Webdav Contextpublic int compareTo(WebdavResource otherRes)
compareTo in interface java.lang.Comparable<WebdavResource>public boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectCopyright © 2001-2010 Jalios SA. All Rights Reserved.