protected void doExecute(VaultFsApp app, CommandLine cl) throws Exception {
boolean quiet = cl.hasOption(OPT_QUIET);
RepositoryAddress src = new RepositoryAddress((String) cl.getValue(srcAddr));
RepositoryAddress dst = new RepositoryAddress((String) cl.getValue(dstAddr));
boolean recursive = cl.hasOption(optRecursive);
RepositoryCopier rcp = new RepositoryCopier();
if (!quiet) {
rcp.setTracker(new DefaultProgressListener());
}
if (cl.hasOption(optSize)) {
rcp.setBatchSize(Integer.parseInt(cl.getValue(optSize).toString()));
}
if (cl.hasOption(optThrottle)) {
rcp.setThrottle(Integer.parseInt(cl.getValue(optThrottle).toString()));
}
if (cl.hasOption(optResumeFrom)) {
rcp.setResumeFrom(cl.getValue(optResumeFrom).toString());
}
rcp.setUpdate(cl.hasOption(optUpdate));
rcp.setOnlyNewer(cl.hasOption(optNewer));
rcp.setNoOrdering(cl.hasOption(optNoOrdering));
rcp.setCredentialsProvider(app.getCredentialsStore());
DefaultWorkspaceFilter srcFilter = new DefaultWorkspaceFilter();
PathFilterSet excludes = new PathFilterSet("/");
for (Object e: cl.getValues(optExclude)) {
excludes.addExclude(new DefaultPathFilter(e.toString()));
}
srcFilter.add(excludes);
rcp.setSourceFilter(srcFilter);
rcp.copy(src, dst, recursive);
}