code: @Override
      public String writeSingle(String spaceId,
                                String chunkChecksum,
                                ChunkInputStream chunk,
                                Map<String, String> properties)
          throws NotFoundException {
          AddContentResult result = writeContent(spaceId,
                                                 chunk.getChunkId(),
                                                 chunk,
                                                 chunk.getChunkSize(),
                                                 properties);
          String finalChecksum = chunk.getMD5();
          if (chunkChecksum != null && chunk.md5Preserved()) {
              if (!chunkChecksum.equals(finalChecksum)) {
                  result.setState(AddContentResult.State.ERROR);
              }
          }
  
          result.setMd5(finalChecksum);
          return finalChecksum;
      }
docs: 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.
  
  @param spaceId    destination where arg chunk content will be written
  @param chunk      content to be written
  @param properties user-defined properties associated with content
  @return MD5 of content
  @throws NotFoundException