org.abstracthorizon.danube.webdav.java
Class Delegate

java.lang.Object
  extended by org.abstracthorizon.danube.webdav.java.Bean
      extended by org.abstracthorizon.danube.webdav.java.Delegate
Direct Known Subclasses:
StringDelegate

public abstract class Delegate
extends Bean

This class adds several methods to the bean (path) object. Adapter is, then, using these methods to obtain various attributes of the object.

Author:
Daniel Sendula

Field Summary
protected  String objectPath
          Parent object path - parent portion of the supplied path
 
Fields inherited from class org.abstracthorizon.danube.webdav.java.Bean
path
 
Constructor Summary
Delegate(String path)
          Constructor
 
Method Summary
 String getContentType(JavaWebDAVResourceAdapter adapter)
          Returns content type.
 InputStream getInputStream(JavaWebDAVResourceAdapter adapter)
          Returns input stream of the object/field's value.
 InputStream getInputStream(JavaWebDAVResourceAdapter adapter, long from, long length)
          Returns input stream of a given range of the object/field's value.
 OutputStream getOutputStream(JavaWebDAVResourceAdapter adapter)
          Returns output stream of the object/field's value.
 OutputStream getOutputStream(JavaWebDAVResourceAdapter adapter, long from, long length)
          Returns output stream of the object/field's value.
 String getResourceETag(JavaWebDAVResourceAdapter adapter)
          Returns etag of the object.
abstract  int resourceLength(JavaWebDAVResourceAdapter adapter)
          Returns resource length
 
Methods inherited from class org.abstracthorizon.danube.webdav.java.Bean
equals, getPath, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

objectPath

protected String objectPath
Parent object path - parent portion of the supplied path

Constructor Detail

Delegate

public Delegate(String path)
Constructor

Parameters:
path - path to the object
Method Detail

resourceLength

public abstract int resourceLength(JavaWebDAVResourceAdapter adapter)
Returns resource length

Parameters:
adapter - adapter it is called from
Returns:
resource length or -1 if unknown.

getResourceETag

public String getResourceETag(JavaWebDAVResourceAdapter adapter)
Returns etag of the object. If not overriden then parent's object identity hash + class name is returned as a weak etag (see RFC-2616)

Parameters:
adapter - adapter
Returns:
an etag

getInputStream

public InputStream getInputStream(JavaWebDAVResourceAdapter adapter)
Returns input stream of the object/field's value. This implementation returns null

Parameters:
adapter - adapter
Returns:
input stream or null

getInputStream

public InputStream getInputStream(JavaWebDAVResourceAdapter adapter,
                                  long from,
                                  long length)
Returns input stream of a given range of the object/field's value. This implementation returns null

Parameters:
adapter - adapter
from - offset
length - length
Returns:
input stream or null

getOutputStream

public OutputStream getOutputStream(JavaWebDAVResourceAdapter adapter)
Returns output stream of the object/field's value. It is used to write into the object/field. This implementation returns null

Parameters:
adapter - adapter
Returns:
output stream or null

getOutputStream

public OutputStream getOutputStream(JavaWebDAVResourceAdapter adapter,
                                    long from,
                                    long length)
Returns output stream of the object/field's value. It is used to write into the object/field. This implementation returns null

Parameters:
adapter - adapter
from - offset
length - length
Returns:
output stream or null

getContentType

public String getContentType(JavaWebDAVResourceAdapter adapter)
Returns content type. This implementation returns "unknown/unknown".

Parameters:
adapter - adapter
Returns:
content type


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.