org.abstracthorizon.danube.webdav.java
Class StringDelegate

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

public abstract class StringDelegate
extends Delegate

Convenience class for deletage. It allows resource's value to be obtained as a string and resource's value to be stored as a string.

Author:
Daniel Sendula

Field Summary
 
Fields inherited from class org.abstracthorizon.danube.webdav.java.Delegate
objectPath
 
Fields inherited from class org.abstracthorizon.danube.webdav.java.Bean
path
 
Constructor Summary
StringDelegate(String path)
          Constructor
 
Method Summary
 String getContentType(JavaWebDAVResourceAdapter adapter)
          Returns type as "text/plain"
 InputStream getInputStream(JavaWebDAVResourceAdapter adapter)
          Returns an input stream of the value returned from the getValueAsString(JavaWebDAVResourceAdapter) method.
protected abstract  String getValueAsString(JavaWebDAVResourceAdapter adapter)
          Returns value as a string
 int resourceLength(JavaWebDAVResourceAdapter adapter)
          Returns resource length by checking resource's value string length
 
Methods inherited from class org.abstracthorizon.danube.webdav.java.Delegate
getInputStream, getOutputStream, getOutputStream, getResourceETag
 
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
 

Constructor Detail

StringDelegate

public StringDelegate(String path)
Constructor

Parameters:
path - path
Method Detail

getValueAsString

protected abstract String getValueAsString(JavaWebDAVResourceAdapter adapter)
Returns value as a string

Parameters:
adapter - adapter
Returns:
value of the resource as a string

resourceLength

public int resourceLength(JavaWebDAVResourceAdapter adapter)
Returns resource length by checking resource's value string length

Specified by:
resourceLength in class Delegate
Parameters:
adapter - adapter
Returns:
resource length

getInputStream

public InputStream getInputStream(JavaWebDAVResourceAdapter adapter)
Returns an input stream of the value returned from the getValueAsString(JavaWebDAVResourceAdapter) method.

Overrides:
getInputStream in class Delegate
Parameters:
adapter - adapter
Returns:
input stream or null

getContentType

public String getContentType(JavaWebDAVResourceAdapter adapter)
Returns type as "text/plain"

Overrides:
getContentType in class Delegate
Parameters:
adapter -
Returns:
"text/plain"


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