|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.abstracthorizon.danube.webdav.fs.FileSystemWebDAVResourceAdapter
public class FileSystemWebDAVResourceAdapter
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 File |
path
Root path of the files to be served |
| Constructor Summary | |
|---|---|
FileSystemWebDAVResourceAdapter()
Constructor |
|
FileSystemWebDAVResourceAdapter(File 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 |
File |
getFilePath()
Returns root file path |
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 |
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 |
setFilePath(File path)
Sets root file path |
void |
setLockingMechanism(LockingMechanism lockingMechanism)
Sets locking mechanism |
void |
setNamespacesProvider(NamespacesProvider namespacesProvider)
Sets namespace provider |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected File 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 FileSystemWebDAVResourceAdapter()
public FileSystemWebDAVResourceAdapter(File path)
path - root directory for files to be served from| Method Detail |
|---|
protected void initHandlers()
public File getFilePath()
public void setFilePath(File path)
path - root file pathpublic NamespacesProvider getNamespacesProvider()
getNamespacesProvider in interface ResourceAdapterpublic void setNamespacesProvider(NamespacesProvider namespacesProvider)
namespacesProvider - namespace providerpublic LockingMechanism getLockingMechanism()
getLockingMechanism in interface ResourceAdapterpublic void setLockingMechanism(LockingMechanism lockingMechanism)
lockingMechanism - locking mechanismpublic Object[] collectionElements(Object resource)
File objects of supplied resource directory
collectionElements in interface ResourceAdapterresource - resource
File objects of supplied resource directory
public void copy(Object source,
Object destination,
boolean recursive)
throws IOException
copy in interface ResourceAdaptersource - 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 ResourceAdapterresource - file
IOException - thrown if there is a problem with deletion of the resourcepublic boolean exists(Object resource)
true if file exists
exists in interface ResourceAdapterresource - resource
true if file existspublic Object findResource(String path)
File object of given path startin from path
findResource in interface ResourceAdapterpath - path
public Object findParentResource(Object resource)
findParentResource in interface ResourceAdapterresource - file
public RequestProperty[] getDefaultRequestProperties(Object resource)
getDefaultRequestProperties in interface ResourceAdapterresource - a file
dirRequestProperties or fileRequestPropertiespublic ResponseProperty[] getDefaultResponseProperties(Object resource)
getDefaultResponseProperties in interface ResourceAdapterresource - a file
dirPropertyNames or filePropertyNamespublic InputStream getInputStream(Object resource)
FileInputStream
getInputStream in interface ResourceAdapterresource - a file
FileInputStream
public InputStream getInpusStream(Object resource,
long from,
long length)
RandomAccessFileRangeInputStream
getInpusStream in interface ResourceAdapterresource - a filefrom - from offsetlength - length in bytes
RandomAccessFileRangeInputStreampublic OutputStream getOutputStream(Object resource)
FileOutputStream
getOutputStream in interface ResourceAdapterresource - a file
FileOutputStream
public OutputStream getOutputStream(Object resource,
long from,
long length)
RandomAccessFileRangeOutputStream
getOutputStream in interface ResourceAdapterresource - a filefrom - from offsetlength - length in bytes
RandomAccessFileRangeOutputStreampublic String getResourceName(Object resource)
getResourceName in interface ResourceAdapterresource - file
public String getResourceETag(Object resource)
getResourceETag in interface ResourceAdapterresource - file
public boolean isCollection(Object resource)
true if file is a directory
isCollection in interface ResourceAdapterresource - a file
true if file is a directory
public void makeCollection(Object resource)
throws IOException
makeCollection in interface ResourceAdapterresource - a file
IOException - thrown in there is a problem in making the file
public void move(Object source,
Object destination)
throws IOException
move in interface ResourceAdaptersource - sourcedestination - destination
IOException - thrown if there is a problem with copying the filepublic long resourceCreated(Object resource)
resourceCreated in interface ResourceAdapterresource - a file
public long resourceLastModified(Object resource)
resourceLastModified in interface ResourceAdapterresource - a file
public long resourceLength(Object resource)
resourceLength in interface ResourceAdapterresource - a file
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||