org.duracloud.chunk.writer
Class FilesystemContentWriter

java.lang.Object
  extended by org.duracloud.chunk.writer.FilesystemContentWriter
All Implemented Interfaces:
ContentWriter

public class FilesystemContentWriter
extends Object
implements ContentWriter

This class implements the ContentWriter interface to write the provided content to a local filesystem.

Author:
Andrew Woods Date: Feb 5, 2010

Constructor Summary
FilesystemContentWriter()
           
 
Method Summary
 List<AddContentResult> getResults()
          This method returns the results of the content write requests.
 void ignore(String spaceId, String contentId, long contentSize)
          This method helps with the book-keeping of which files are ignored.
 ChunksManifest write(String spaceId, ChunkableContent chunkable)
          This method implements the ContentWriter interface for writing content to a DataStore.
 String writeSingle(String spaceId, String chunkChecksum, ChunkInputStream chunk)
          This method implements the ContentWriter interface for writing content to a DataStore.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilesystemContentWriter

public FilesystemContentWriter()
Method Detail

getResults

public List<AddContentResult> getResults()
This method returns the results of the content write requests.

Specified by:
getResults in interface ContentWriter
Returns:
List of results

ignore

public void ignore(String spaceId,
                   String contentId,
                   long contentSize)
Description copied from interface: ContentWriter
This method helps with the book-keeping of which files are ignored.

Specified by:
ignore in interface ContentWriter
Parameters:
spaceId - destination where arg content was assigned to be written
contentId - of content
contentSize - of content

write

public ChunksManifest write(String spaceId,
                            ChunkableContent chunkable)
                     throws NotFoundException
This method implements the ContentWriter interface for writing content to a DataStore. In this case, the DataStore is a local filesystem. The arg spaceId is the path to the destination directory.

Specified by:
write in interface ContentWriter
Parameters:
spaceId - destination where arg chunkable content will be written
chunkable - content to be written
Returns:
ChunksManifest of written content
Throws:
NotFoundException - on error

writeSingle

public String writeSingle(String spaceId,
                          String chunkChecksum,
                          ChunkInputStream chunk)
                   throws NotFoundException
This method implements the ContentWriter interface for writing content to a DataStore. In this case, the DataStore is a local filesystem. The arg spaceId is the path to the destination directory.

Specified by:
writeSingle in interface ContentWriter
Parameters:
spaceId - destination where arg chunk content will be written
chunk - content to be written
chunkChecksum - md5 checksum of the chunk if known, null otherwise
Returns:
MD5 of content
Throws:
NotFoundException


Copyright © 2009-2011 DuraSpace. All Rights Reserved.