Class 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 Detail

      • FilesystemContentWriter

        public FilesystemContentWriter()
    • Method Detail

      • 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
      • write

        public ChunksManifest write​(String spaceId,
                                    ChunkableContent chunkable,
                                    Map<String,​String> contentProperties)
                             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
        contentProperties - 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 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
        properties - user-defined properties associated with content
        chunkChecksum - 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: ContentWriter
        This 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:
        writeSingle in interface ContentWriter
        Parameters:
        spaceId - destination where arg chunk content will be written
        chunkChecksum - md5 checksum of the chunk if known, null otherwise
        chunk - content to be written
        Returns:
        MD5 of content
        Throws:
        NotFoundException - on error