Package org.duracloud.chunk.writer
Class FilesystemContentWriter
java.lang.Object
org.duracloud.chunk.writer.FilesystemContentWriter
- All Implemented Interfaces:
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis method returns the results of the content write requests.voidThis method helps with the book-keeping of which files are ignored.write(String spaceId, ChunkableContent chunkable) This method implements the ContentWriter interface for writing content to a DataStore.This method implements the ContentWriter interface for writing content to a DataStore.writeSingle(String spaceId, String chunkChecksum, ChunkInputStream chunk) This method writes the arg Chunk to the arg space.writeSingle(String spaceId, String chunkChecksum, ChunkInputStream chunk, Map<String, String> properties) This method implements the ContentWriter interface for writing content to a DataStore.
-
Constructor Details
-
FilesystemContentWriter
public FilesystemContentWriter()
-
-
Method Details
-
getResults
This method returns the results of the content write requests.- Specified by:
getResultsin interfaceContentWriter- Returns:
- List of results
-
ignore
Description copied from interface:ContentWriterThis method helps with the book-keeping of which files are ignored.- Specified by:
ignorein interfaceContentWriter- Parameters:
spaceId- destination where arg content was assigned to be writtencontentId- of contentcontentSize- of content
-
write
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:
writein interfaceContentWriter- Parameters:
spaceId- destination where arg chunkable content will be writtenchunkable- content to be written- Returns:
- ChunksManifest of written content
- Throws:
NotFoundException- on error
-
write
public ChunksManifest write(String spaceId, ChunkableContent chunkable, Map<String, String> contentProperties) throws NotFoundExceptionThis 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:
writein interfaceContentWriter- Parameters:
spaceId- destination where arg chunkable content will be writtencontentProperties- user defined properties to be associated with content.chunkable- content to be written- Returns:
- ChunksManifest of written content
- Throws:
NotFoundException- on error
-
writeSingle
public String writeSingle(String spaceId, String chunkChecksum, ChunkInputStream chunk, Map<String, String> properties) throws NotFoundExceptionThis 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:
writeSinglein interfaceContentWriter- Parameters:
spaceId- destination where arg chunk content will be writtenchunk- content to be writtenproperties- user-defined properties associated with contentchunkChecksum- md5 checksum of the chunk if known, null otherwise- Returns:
- MD5 of content
- Throws:
NotFoundException
-
writeSingle
public String writeSingle(String spaceId, String chunkChecksum, ChunkInputStream chunk) throws NotFoundException Description copied from interface:ContentWriterThis method writes the arg Chunk to the arg space. It is intended for use when when the arg chunk is actually a complete piece of content- Specified by:
writeSinglein interfaceContentWriter- Parameters:
spaceId- destination where arg chunk content will be writtenchunkChecksum- md5 checksum of the chunk if known, null otherwisechunk- content to be written- Returns:
- MD5 of content
- Throws:
NotFoundException- on error
-