|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.abstracthorizon.danube.webdav.java.JavaWebDAVResourceAdapter
public class JavaWebDAVResourceAdapter
Main class in reflection java resource adapter. This resource adapter allows WebDAV to be used in accessing internals of java objects. It exposes collections, maps, array, spring framework application contexts, java bean properties and methods to the WebDAV handler.
Field Summary | |
---|---|
protected DAVNamespace |
davNamespace
DAV namespace. |
protected static ResponseProperty[] |
dirPropertyNames
Available property names for 'dirs' |
protected static RequestProperty[] |
dirRequestProperties
Dir request properties |
protected static ResponseProperty[] |
filePropertyNames
Available property names for files |
protected static RequestProperty[] |
fileRequestProperties
File request propertyes |
protected LockingMechanism |
lockingMechanism
Locking mechanism. |
protected NamespacesProvider |
namespacesProvider
Namespace provider. |
protected Object |
rootObject
Root object |
Constructor Summary | |
---|---|
JavaWebDAVResourceAdapter()
Constructor |
|
JavaWebDAVResourceAdapter(Object rootObject)
Constructor |
Method Summary | |
---|---|
Object[] |
collectionElements(Object resource)
Returns null if resource is delegate. |
void |
copy(Object source,
Object destination,
boolean recursive)
Not implemented |
void |
delete(Object resource)
Not implemented |
boolean |
exists(Object resource)
Returns if resource exists. |
protected Object |
findObjectImpl(Bean bean)
This method returns real object from the given bean |
protected Object |
findObjectImpl(String resourcePath)
This method returns real object from the given path |
Object |
findParentResource(Object resource)
Returns parent resource of the given resource. |
Object |
findResource(String resourcePath)
Finds a resource (object) from the given path. |
String |
getContentType(Object resource)
Returns content type. |
RequestProperty[] |
getDefaultRequestProperties(Object resource)
|
ResponseProperty[] |
getDefaultResponseProperties(Object resource)
|
InputStream |
getInpusStream(Object resource,
long from,
long length)
Returns input stream. |
InputStream |
getInputStream(Object resource)
Returns input stream. |
LockingMechanism |
getLockingMechanism()
Returns locking mechanism |
NamespacesProvider |
getNamespacesProvider()
Returns namespace provider |
OutputStream |
getOutputStream(Object resource)
Returns output stream. |
OutputStream |
getOutputStream(Object resource,
long from,
long length)
Returns output stream. |
String |
getResourceETag(Object resource)
Returns etag. |
String |
getResourceName(Object resource)
Returns resource name from the last portion of the path |
Object |
getRootObject()
Returns root object |
protected void |
initHandlers()
Initialises java dav facotry and sets namespace |
boolean |
isCollection(Object resource)
Returns if resource is collection. |
void |
makeCollection(Object resource)
Not implemented |
void |
move(Object source,
Object destination)
Not implemented |
long |
resourceCreated(Object resource)
Returns -1 |
long |
resourceLastModified(Object resource)
Returns -1 |
long |
resourceLength(Object resource)
Returns resource length. |
void |
setLockingMechanism(LockingMechanism lockingMechanism)
Sets locking mechanism |
void |
setNamespacesProvider(NamespacesProvider namespacesProvider)
Sets namespace provider |
void |
setRootObject(Object root)
Sets root object |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Object rootObject
protected static ResponseProperty[] filePropertyNames
protected static ResponseProperty[] dirPropertyNames
protected static RequestProperty[] fileRequestProperties
protected static RequestProperty[] dirRequestProperties
protected NamespacesProvider namespacesProvider
SimpleNamespacesProvider
.
protected LockingMechanism lockingMechanism
SimpleInMemoryLockingMechanism
.
protected DAVNamespace davNamespace
DAVNamespace
Constructor Detail |
---|
public JavaWebDAVResourceAdapter()
public JavaWebDAVResourceAdapter(Object rootObject)
rootObject
- root objectMethod Detail |
---|
protected void initHandlers()
public Object getRootObject()
public void setRootObject(Object root)
root
- root objectpublic 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 findResource(String resourcePath)
Bean
or extension of that object
findResource
in interface ResourceAdapter
resourcePath
- path to the resource
protected Object findObjectImpl(Bean bean)
bean
- bean (defines path)
null
if failedprotected Object findObjectImpl(String resourcePath)
path
- path
null
if failedpublic Object findParentResource(Object resource)
bean
object (or extension) and returns that. If object
is already root objec then it returns null
findParentResource
in interface ResourceAdapter
resource
- existing resource
public long resourceLength(Object resource)
Delegate
if resource is of that type.
resourceLength
in interface ResourceAdapter
resource
- resource
public long resourceLastModified(Object resource)
resourceLastModified
in interface ResourceAdapter
resource
- resource
public long resourceCreated(Object resource)
resourceCreated
in interface ResourceAdapter
resource
- resource
public String getResourceName(Object resource)
getResourceName
in interface ResourceAdapter
resource
- resource name
public String getResourceETag(Object resource)
Delegate
if resource is of that type.
getResourceETag
in interface ResourceAdapter
resource
- resource
public boolean exists(Object resource)
exists
in interface ResourceAdapter
resource
- resource
true
if resource exists.public boolean isCollection(Object resource)
Delegate
if resource is of that type.
isCollection
in interface ResourceAdapter
resource
- resource
true
if resource is collectionpublic void delete(Object resource) throws IOException
delete
in interface ResourceAdapter
resource
- resource
IOException
- if there were errors while deleting the resourcepublic void makeCollection(Object resource) throws IOException
makeCollection
in interface ResourceAdapter
resource
- resource
IOException
- if there were errors while collection is createdpublic void copy(Object source, Object destination, boolean recursive) throws IOException
copy
in interface ResourceAdapter
source
- sourcedestination
- destinationrecursive
- deep copy
IOException
- if there were errors while copying resource(s)public void move(Object source, Object destination) throws IOException
move
in interface ResourceAdapter
source
- sourcedestination
- destination
IOException
- if there were errors while moving resource(s)public Object[] collectionElements(Object resource)
null
if resource is delegate. Otherwise
returns list of collection, map, arrays, properties, methods, etc..
collectionElements
in interface ResourceAdapter
resource
- resource
public RequestProperty[] getDefaultRequestProperties(Object resource)
getDefaultRequestProperties
in interface ResourceAdapter
public ResponseProperty[] getDefaultResponseProperties(Object resource)
getDefaultResponseProperties
in interface ResourceAdapter
public InputStream getInputStream(Object resource)
Delegate
if resource is of that type.
getInputStream
in interface ResourceAdapter
resource
- resource
null
public InputStream getInpusStream(Object resource, long from, long length)
Delegate
if resource is of that type.
getInpusStream
in interface ResourceAdapter
from
- offsetlength
- lengthresource
- resource
null
public OutputStream getOutputStream(Object resource)
Delegate
if resource is of that type.
getOutputStream
in interface ResourceAdapter
resource
- resource
null
public OutputStream getOutputStream(Object resource, long from, long length)
Delegate
if resource is of that type.
getOutputStream
in interface ResourceAdapter
from
- offsetlength
- lengthresource
- resource
null
public String getContentType(Object resource)
Delegate
if resource is of that type.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |