public CasConfig withConnectionString(String connectionString) { setConnectionString(connectionString); return this; } }
public TestConfig withDiscardData(boolean discardData) { setDiscardData(discardData); return this; }
protected LinkOption[] getLinkOptions() { return config.isFollowLinks() ? new LinkOption[0] : new LinkOption[]{LinkOption.NOFOLLOW_LINKS}; }
@Test public void testArchive() { final File archive = new File("/tmp/ecs-sync-archive-test.zip"); if (archive.exists()) archive.delete(); archive.deleteOnExit(); ArchiveConfig archiveConfig = new ArchiveConfig(); archiveConfig.setPath(archive.getPath()); archiveConfig.setStoreMetadata(true); TestConfig testConfig = new TestConfig().withReadData(true).withDiscardData(false); testConfig.withObjectCount(LG_OBJ_COUNT).withMaxSize(LG_OBJ_MAX_SIZE); endToEndTest(archiveConfig, testConfig, null, false); }
/** * @param nfs * @return */ private NfsConfig getNfsConfig(Nfs nfs) { NfsConfig nfsConfig = new NfsConfig(); nfsConfig.setServer(nfs.getServer()); nfsConfig.setMountPath(nfs.getExportedPath() + testDirectoryPath); return nfsConfig; } }
@Override public Void call() { s3.deleteObject(config.getBucketName(), identifier); return null; } }, OPERATION_DELETE_OBJECT);
@Override public String getIdentifier(String relativePath, boolean directory) { if (relativePath == null || relativePath.length() == 0) return config.getKeyPrefix(); String identifier = config.getKeyPrefix() + relativePath; // append trailing slash for directories if (directory) identifier += "/"; return identifier; }
@Override public String getIdentifier(String relativePath, boolean directory) { if (relativePath == null || relativePath.length() == 0) return config.getKeyPrefix(); String identifier = config.getKeyPrefix() + relativePath; // append trailing slash for directories if (directory) identifier += "/"; return identifier; }
@Override public Void call() { s3.deleteObject(config.getBucketName(), identifier); return null; } }, OPERATION_DELETE_OBJECT);
@Override public Iterable<ObjectSummary> allObjects() { if (config.isIncludeVersions()) { return new Iterable<ObjectSummary>() { @Override public Iterator<ObjectSummary> iterator() { return new CombinedIterator<>(Arrays.asList(new PrefixIterator(config.getKeyPrefix()), new DeletedObjectIterator(config.getKeyPrefix()))); } }; } else { return new Iterable<ObjectSummary>() { @Override public Iterator<ObjectSummary> iterator() { return new PrefixIterator(config.getKeyPrefix()); } }; } }
@Override public Iterable<ObjectSummary> allObjects() { if (config.isIncludeVersions()) { return new Iterable<ObjectSummary>() { @Override public Iterator<ObjectSummary> iterator() { return new CombinedIterator<>(Arrays.asList(new PrefixIterator(config.getKeyPrefix()), new DeletedObjectIterator(config.getKeyPrefix()))); } }; } else { return new Iterable<ObjectSummary>() { @Override public Iterator<ObjectSummary> iterator() { return new PrefixIterator(config.getKeyPrefix()); } }; } }
private String casWriteClip(CasClip clip) throws FPLibraryException { String clipId; if (config.isSynchronizeClipWrite()) synchronized (pool) { clipId = clip.Write(); } else clipId = clip.Write(); return clipId; }
@Override public AccessControlList call() { if (versionId == null) return s3.getObjectAcl(config.getBucketName(), key); else return s3.getObjectAcl(config.getBucketName(), key, versionId); } }, OPERATION_GET_ACL);
@Override public String getRelativePath(String identifier, boolean directory) { String relativePath = identifier; if (relativePath.startsWith(config.getKeyPrefix())) relativePath = relativePath.substring(config.getKeyPrefix().length()); // remove trailing slash from directories if (directory && relativePath.endsWith("/")) relativePath = relativePath.substring(0, relativePath.length() - 1); return relativePath; }
@Override public String getRelativePath(String identifier, boolean directory) { String relativePath = identifier; if (relativePath.startsWith(config.getKeyPrefix())) relativePath = relativePath.substring(config.getKeyPrefix().length()); // remove trailing slash from directories if (directory && relativePath.endsWith("/")) relativePath = relativePath.substring(0, relativePath.length() - 1); return relativePath; }
@Override public Void call() { s3.deleteObject(config.getBucketName(), identifier); return null; } }, OPERATION_DELETE_OBJECT);
@Override public Void call() { s3.deleteObject(config.getBucketName(), identifier); return null; } }, OPERATION_DELETE_OBJECT);
@Override public Iterator<ObjectSummary> iterator() { return new PrefixIterator(config.getKeyPrefix()); } };
@Override public Iterator<ObjectSummary> iterator() { return new PrefixIterator(config.getKeyPrefix()); } };
@Override public VersionListing call() { if (fListing == null) { return s3.listVersions(config.getBucketName(), key, null, null, "/", null); } else { return s3.listNextBatchOfVersions(fListing); } } }, OPERATION_LIST_VERSIONS);