@Test public void testChecksum() throws Exception { 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 Path file = new Path(container, "a", EnumSet.of(Path.Type.file)); 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 Checksum checksum = service.checksum(new MD5ChecksumCompute(), Arrays.asList(a, b)); assertEquals(new MD5ChecksumCompute().compute(IOUtils.toInputStream("m1m2", Charset.defaultCharset()), new TransferStatus()), checksum); }
public Checksum checksum(final ChecksumCompute checksum, final List<StorageObject> objects) throws ChecksumException { final StringBuilder concatenated = new StringBuilder(); for(StorageObject s : objects) { concatenated.append(s.getMd5sum()); } return checksum.compute(IOUtils.toInputStream(concatenated.toString(), Charset.defaultCharset()), new TransferStatus()); }
SwiftSegmentService { public Checksum checksum(final ChecksumCompute checksum, final List<StorageObject> objects) throws ChecksumException { final StringBuilder concatenated = new StringBuilder(); for(StorageObject s : objects) { concatenated.append(s.getMd5sum()); } return checksum.compute(IOUtils.toInputStream(concatenated.toString(), Charset.defaultCharset()), new TransferStatus()); } }
SwiftSegmentService { public Checksum checksum(final ChecksumCompute checksum, final List<StorageObject> objects) throws ChecksumException { final StringBuilder concatenated = new StringBuilder(); for(StorageObject s : objects) { concatenated.append(s.getMd5sum()); } return checksum.compute(IOUtils.toInputStream(concatenated.toString(), Charset.defaultCharset()), new TransferStatus()); } 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 Checksum checksum(final ChecksumCompute checksum, final List<StorageObject> objects) throws ChecksumException { final StringBuilder concatenated = new StringBuilder(); for(StorageObject s : objects) { concatenated.append(s.getMd5sum()); } return checksum.compute(IOUtils.toInputStream(concatenated.toString(), Charset.defaultCharset()), new TransferStatus()); } 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 Checksum checksum(final ChecksumCompute checksum, final List<StorageObject> objects) throws ChecksumException { final StringBuilder concatenated = new StringBuilder(); for(StorageObject s : objects) { concatenated.append(s.getMd5sum()); } return checksum.compute(IOUtils.toInputStream(concatenated.toString(), Charset.defaultCharset()), new TransferStatus()); } 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);  }