FilesystemContentWriter implements ContentWriter { public ChunksManifest write(String spaceId, ChunkableContent chunkable) throws NotFoundException { return write(spaceId, chunkable, null); }  List<AddContentResult> getResults(); void ignore(String spaceId, String contentId, long contentSize); ChunksManifest write(String spaceId,
                                ChunkableContent chunkable); ChunksManifest write(String spaceId,
                                ChunkableContent chunkable,
                                Map<String, String> contentProperties); @Override String writeSingle(String spaceId,
                              String chunkChecksum,
                              ChunkInputStream chunk,
                              Map<String, String> properties); @Override String writeSingle(String spaceId,
                              String chunkChecksum,
                              ChunkInputStream chunk);  }
@Test public void testWrite() throws NotFoundException, IOException { long contentSize = 4000; InputStream contentStream = createContentStream(contentSize); File destSpace = new File(destDir, "spaceId-0"); String spaceId = destSpace.getPath(); String sep = File.separator; String contentId = "a" + sep + "b" + sep + "c" + sep + "contentId"; int numChunks = 4; long maxChunkSize = 1000; ChunkableContent chunkable = new ChunkableContent(contentId, contentStream, contentSize, maxChunkSize); chunkable.setPreserveChunkMD5s(true); ChunksManifest manifest = writer.write(spaceId, chunkable); IOFileFilter all = FileFilterUtils.trueFileFilter(); Collection<File> files = FileUtils.listFiles(destSpace, all, all); Assert.assertNotNull(files); Assert.assertEquals(numChunks + 1, files.size()); for (File file : files) { String filePath = file.getPath(); Assert.assertTrue(filePath, filePath.indexOf(contentId) != -1); } Assert.assertNotNull(manifest); ChunksManifestBean.ManifestHeader header = manifest.getHeader(); Assert.assertNotNull(header); List<ChunksManifestBean.ManifestEntry> entries = manifest.getEntries(); Assert.assertNotNull(entries); Assert.assertEquals(numChunks, entries.size()); KnownLengthInputStream body = manifest.getBody(); Assert.assertNotNull(body); Assert.assertTrue(body.getLength() > 0); verifyResults(writer.getResults(), files); }