com.bigllc.retsiq.simpleclient
Class FileWriterObjectHandler
java.lang.Object
com.bigllc.retsiq.simpleclient.FileWriterObjectHandler
- All Implemented Interfaces:
- ObjectResponseHandler
- Direct Known Subclasses:
- DefaultObjectHandler
public abstract class FileWriterObjectHandler
- extends java.lang.Object
- implements ObjectResponseHandler
This abstract object response handler writes to files and generates the.
file name contentId-objectId.extension. Where the extension is determined
by the content type.
Super classes should implement getDirectory() and return a File object
that the file will be written to.
- Author:
- Marc G. Smith
|
Method Summary |
protected abstract java.io.File |
getDirectory(java.lang.String contentType,
java.lang.String contentId,
java.lang.String objectId)
Implementing super classes should return the directory to write this
image to. |
java.lang.String |
object(java.lang.String contentType,
java.lang.String contentId,
java.lang.String objectId,
java.io.InputStream in)
This method is called by the getObject method for each object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileWriterObjectHandler
public FileWriterObjectHandler()
getDirectory
protected abstract java.io.File getDirectory(java.lang.String contentType,
java.lang.String contentId,
java.lang.String objectId)
- Implementing super classes should return the directory to write this
image to.
object
public java.lang.String object(java.lang.String contentType,
java.lang.String contentId,
java.lang.String objectId,
java.io.InputStream in)
throws RETSClientException
- Description copied from interface:
ObjectResponseHandler
- This method is called by the getObject method for each object.
The handler implementation is responsible for writing the object.
- Specified by:
object in interface ObjectResponseHandler
- Parameters:
contentType - the content type for the objectcontentId - the content id of the objectobjectId - the object id of the objectin - the input stream of the object
- Returns:
- The uri of the persisted object
- Throws:
RETSClientException