FileChunker { public void addContent(String destSpaceId, String destContentId, String fileChecksum, File file) { Map<String, String> properties = StorageProviderUtil.createContentProperties(file.getAbsolutePath(), null); addContent(destSpaceId, destContentId, fileChecksum, file.length(), getInputStream(file), properties); } FileChunker(ContentWriter contentWriter);  FileChunker(ContentWriter contentWriter,
                       FileChunkerOptions options); void addContent(String destSpaceId,
                           String destContentId,
                           String fileChecksum,
                           File file); void addContent(String destSpaceId,
                           String destContentId,
                           String fileChecksum,
                           long fileSize,
                           InputStream stream,
                           Map<String, String> properties); static DigestInputStream createTestContent(File outFile,
                                                      long size);  }
@Test public void testAddContent() throws Exception { long chunkSize = 1000; long fileSize = chunkSize + chunkSize / 2; String fileName = "add-content-test.txt"; FileChunker chunker = new FileChunker(writer, new FileChunkerOptions(chunkSize)); File file = createAndVerifyContent(fileName, fileSize); ChecksumUtil util = new ChecksumUtil(ChecksumUtil.Algorithm.MD5); String fileChecksum = util.generateChecksum(file); chunker.addContent(destDir.getPath(), fileName, fileChecksum, file); File chunk1 = new File(destDir, fileName + ".dura-chunk-0000"); File chunk2 = new File(destDir, fileName + ".dura-chunk-0001"); File manifest = new File(destDir, fileName + ".dura-manifest"); Assert.assertTrue(chunk1.exists()); Assert.assertTrue(chunk2.exists()); Assert.assertTrue(manifest.exists()); }