|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.abstracthorizon.danube.webdav.spring.SpringResourceWebDAVResourceAdapter
public class SpringResourceWebDAVResourceAdapter
Simple file system resource adapter
Field Summary | |
---|---|
protected DAVNamespace |
davNamespace
Default DAV namespace |
protected static ResponseProperty[] |
dirPropertyNames
Default directory property names |
protected static RequestProperty[] |
dirRequestProperties
Default dir request properties |
protected static ResponseProperty[] |
filePropertyNames
Default file property names |
protected static RequestProperty[] |
fileRequestProperties
Default file request properties |
protected LockingMechanism |
lockingMechanism
Locking mechanism to be used with this adapter |
protected NamespacesProvider |
namespacesProvider
Namespace provider to be used with this adapter |
protected Resource |
path
Root path of the files to be served |
Constructor Summary | |
---|---|
SpringResourceWebDAVResourceAdapter()
Constructor |
|
SpringResourceWebDAVResourceAdapter(Resource path)
Constructor |
Method Summary | |
---|---|
Object[] |
collectionElements(Object resource)
Returns File objects of supplied resource directory |
void |
copy(Object source,
Object destination,
boolean recursive)
Copies source file to destination file |
void |
delete(Object resource)
Deletes a file |
boolean |
exists(Object resource)
Returns true if file exists |
Object |
findParentResource(Object resource)
Returns file's parent |
Object |
findResource(String path)
Returns File object of given path startin from path |
RequestProperty[] |
getDefaultRequestProperties(Object resource)
Returns default request properties |
ResponseProperty[] |
getDefaultResponseProperties(Object resource)
Returns default response properties |
InputStream |
getInpusStream(Object resource,
long from,
long length)
Returns RandomAccessFileRangeInputStream |
InputStream |
getInputStream(Object resource)
Returns FileInputStream |
LockingMechanism |
getLockingMechanism()
Returns locking mechanism |
NamespacesProvider |
getNamespacesProvider()
Returns namespace provider |
OutputStream |
getOutputStream(Object resource)
Returns FileOutputStream |
OutputStream |
getOutputStream(Object resource,
long from,
long length)
Returns RandomAccessFileRangeOutputStream |
String |
getResourceETag(Object resource)
Returns file's last modified timestamp as hex plus file's absolute path |
String |
getResourceName(Object resource)
Returns file's name |
Resource |
getResourcePath()
Returns root file path |
protected void |
initHandlers()
Initialises handlers |
boolean |
isCollection(Object resource)
Returns true if file is a directory |
void |
makeCollection(Object resource)
Makes a directory |
void |
move(Object source,
Object destination)
Renames the file |
long |
resourceCreated(Object resource)
Returns file's last modified timestamp |
long |
resourceLastModified(Object resource)
Returns file's last modified timestamp |
long |
resourceLength(Object resource)
Returns file's length |
void |
setLockingMechanism(LockingMechanism lockingMechanism)
Sets locking mechanism |
void |
setNamespacesProvider(NamespacesProvider namespacesProvider)
Sets namespace provider |
void |
setResourcePath(Resource path)
Sets root file path |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Resource path
protected static ResponseProperty[] filePropertyNames
protected static ResponseProperty[] dirPropertyNames
protected static RequestProperty[] fileRequestProperties
protected static RequestProperty[] dirRequestProperties
protected NamespacesProvider namespacesProvider
protected LockingMechanism lockingMechanism
protected DAVNamespace davNamespace
Constructor Detail |
---|
public SpringResourceWebDAVResourceAdapter()
public SpringResourceWebDAVResourceAdapter(Resource path)
path
- root directory for files to be served fromMethod Detail |
---|
protected void initHandlers()
public Resource getResourcePath()
public void setResourcePath(Resource path)
path
- root file pathpublic NamespacesProvider getNamespacesProvider()
getNamespacesProvider
in interface ResourceAdapter
public void setNamespacesProvider(NamespacesProvider namespacesProvider)
namespacesProvider
- namespace providerpublic LockingMechanism getLockingMechanism()
getLockingMechanism
in interface ResourceAdapter
public void setLockingMechanism(LockingMechanism lockingMechanism)
lockingMechanism
- locking mechanismpublic Object[] collectionElements(Object resource)
File
objects of supplied resource directory
collectionElements
in interface ResourceAdapter
resource
- resource
File
objects of supplied resource directorypublic void copy(Object source, Object destination, boolean recursive) throws IOException
copy
in interface ResourceAdapter
source
- source filedestination
- destination filerecursive
- is it deep copy
IOException
- thrown if there is a problem with copying.public void delete(Object resource) throws IOException
delete
in interface ResourceAdapter
resource
- file
IOException
- thrown if there is a problem with deletion of the resourcepublic boolean exists(Object resource)
true
if file exists
exists
in interface ResourceAdapter
resource
- resource
true
if file existspublic Object findResource(String path)
File
object of given path startin from path
findResource
in interface ResourceAdapter
path
- path
public Object findParentResource(Object resource)
findParentResource
in interface ResourceAdapter
resource
- file
public RequestProperty[] getDefaultRequestProperties(Object resource)
getDefaultRequestProperties
in interface ResourceAdapter
resource
- a file
dirRequestProperties
or fileRequestProperties
public ResponseProperty[] getDefaultResponseProperties(Object resource)
getDefaultResponseProperties
in interface ResourceAdapter
resource
- a file
dirPropertyNames
or filePropertyNames
public InputStream getInputStream(Object resource)
FileInputStream
getInputStream
in interface ResourceAdapter
resource
- a file
FileInputStream
public InputStream getInpusStream(Object resource, long from, long length)
RandomAccessFileRangeInputStream
getInpusStream
in interface ResourceAdapter
resource
- a filefrom
- from offsetlength
- length in bytes
RandomAccessFileRangeInputStream
public OutputStream getOutputStream(Object resource)
FileOutputStream
getOutputStream
in interface ResourceAdapter
resource
- a file
FileOutputStream
public OutputStream getOutputStream(Object resource, long from, long length)
RandomAccessFileRangeOutputStream
getOutputStream
in interface ResourceAdapter
resource
- a filefrom
- from offsetlength
- length in bytes
RandomAccessFileRangeOutputStream
public String getResourceName(Object resource)
getResourceName
in interface ResourceAdapter
resource
- file
public String getResourceETag(Object resource)
getResourceETag
in interface ResourceAdapter
resource
- file
public boolean isCollection(Object resource)
true
if file is a directory
isCollection
in interface ResourceAdapter
resource
- a file
true
if file is a directorypublic void makeCollection(Object resource) throws IOException
makeCollection
in interface ResourceAdapter
resource
- a file
IOException
- thrown in there is a problem in making the filepublic void move(Object source, Object destination) throws IOException
move
in interface ResourceAdapter
source
- sourcedestination
- destination
IOException
- thrown if there is a problem with copying the filepublic long resourceCreated(Object resource)
resourceCreated
in interface ResourceAdapter
resource
- a file
public long resourceLastModified(Object resource)
resourceLastModified
in interface ResourceAdapter
resource
- a file
public long resourceLength(Object resource)
resourceLength
in interface ResourceAdapter
resource
- a file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |