@Test public void testManifest() { final SwiftSegmentService service = new SwiftSegmentService(session); final Path container = new Path("test.cyberduck.ch", EnumSet.of(Path.Type.directory, Path.Type.volume)); container.attributes().setRegion("IAD"); final StorageObject a = new StorageObject("a"); a.setMd5sum("m1"); a.setSize(1L); final StorageObject b = new StorageObject("b"); b.setMd5sum("m2"); b.setSize(1L); final String manifest = service.manifest(container.getName(), Arrays.asList(a, b)); assertEquals("[{\"path\":\"/test.cyberduck.ch/a\",\"etag\":\"m1\",\"size_bytes\":1},{\"path\":\"/test.cyberduck.ch/b\",\"etag\":\"m2\",\"size_bytes\":1}]", manifest); }
public String manifest(final String container, final List<StorageObject> objects) { JsonArray manifestSLO = new JsonArray(); for(StorageObject s : objects) { JsonObject segmentJSON = new JsonObject(); segmentJSON.addProperty("path", String.format("/%s/%s", container, s.getName())); segmentJSON.addProperty("etag", s.getMd5sum()); segmentJSON.addProperty("size_bytes", s.getSize()); manifestSLO.add(segmentJSON); } return manifestSLO.toString(); }
SwiftSegmentService { public String manifest(final String container, final List<StorageObject> objects) { JsonArray manifestSLO = new JsonArray(); for(StorageObject s : objects) { JsonObject segmentJSON = new JsonObject(); segmentJSON.addProperty("path", String.format("/%s/%s", container, s.getName())); segmentJSON.addProperty("etag", s.getMd5sum()); segmentJSON.addProperty("size_bytes", s.getSize()); manifestSLO.add(segmentJSON); } return manifestSLO.toString(); } }
SwiftSegmentService { public String manifest(final String container, final List<StorageObject> objects) { JsonArray manifestSLO = new JsonArray(); for(StorageObject s : objects) { JsonObject segmentJSON = new JsonObject(); segmentJSON.addProperty("path", String.format("/%s/%s", container, s.getName())); segmentJSON.addProperty("etag", s.getMd5sum()); segmentJSON.addProperty("size_bytes", s.getSize()); manifestSLO.add(segmentJSON); } return manifestSLO.toString(); } SwiftSegmentService(final SwiftSession session);  SwiftSegmentService(final SwiftSession session, final String prefix);  SwiftSegmentService(final SwiftSession session, final SwiftRegionService regionService);  SwiftSegmentService(final SwiftSession session, final SwiftRegionService regionService, final String prefix); }
SwiftSegmentService { public String manifest(final String container, final List<StorageObject> objects) { JsonArray manifestSLO = new JsonArray(); for(StorageObject s : objects) { JsonObject segmentJSON = new JsonObject(); segmentJSON.addProperty("path", String.format("/%s/%s", container, s.getName())); segmentJSON.addProperty("etag", s.getMd5sum()); segmentJSON.addProperty("size_bytes", s.getSize()); manifestSLO.add(segmentJSON); } return manifestSLO.toString(); } SwiftSegmentService(final SwiftSession session);  SwiftSegmentService(final SwiftSession session, final String prefix);  SwiftSegmentService(final SwiftSession session, final SwiftRegionService regionService);  SwiftSegmentService(final SwiftSession session, final SwiftRegionService regionService, final String prefix); List<Path> list(final Path file); Path getSegmentsDirectory(final Path file, final Long size); Path getSegment(final Path file, final Long size, int segmentNumber); String manifest(final String container, final List<StorageObject> objects); Checksum checksum(final ChecksumCompute checksum, final List<StorageObject> objects); }
SwiftSegmentService { public String manifest(final String container, final List<StorageObject> objects) { JsonArray manifestSLO = new JsonArray(); for(StorageObject s : objects) { JsonObject segmentJSON = new JsonObject(); segmentJSON.addProperty("path", String.format("/%s/%s", container, s.getName())); segmentJSON.addProperty("etag", s.getMd5sum()); segmentJSON.addProperty("size_bytes", s.getSize()); manifestSLO.add(segmentJSON); } return manifestSLO.toString(); } SwiftSegmentService(final SwiftSession session);  SwiftSegmentService(final SwiftSession session, final String prefix);  SwiftSegmentService(final SwiftSession session, final SwiftRegionService regionService);  SwiftSegmentService(final SwiftSession session, final SwiftRegionService regionService, final String prefix); List<Path> list(final Path file); Path getSegmentsDirectory(final Path file, final Long size); Path getSegment(final Path file, final Long size, int segmentNumber); String manifest(final String container, final List<StorageObject> objects); Checksum checksum(final ChecksumCompute checksum, final List<StorageObject> objects);  }