final String[] paths = request.getPaths();
DefaultWorkspaceFilter filter = new DefaultWorkspaceFilter();
DefaultMetaInf inf = new DefaultMetaInf();
ExportOptions opts = new ExportOptions();
for (String path : paths) {
filter.add(new PathFilterSet(path));
}
inf.setFilter(filter);
Properties props = new Properties();
String packageGroup = "sling/replication";
props.setProperty(VaultPackage.NAME_GROUP, packageGroup);
String packageName = String.valueOf(request.getTime());
props.setProperty(VaultPackage.NAME_NAME, packageName);
props.setProperty(VaultPackage.NAME_VERSION, VERSION);
inf.setProperties(props);
log.debug("assembling package {}", packageGroup + '/' + packageName + "-" + VERSION);
opts.setMetaInf(inf);
opts.setRootPath("/");
File tmpFile = File.createTempFile("rp-vlt-create-" + System.nanoTime(), ".zip");
VaultPackage vaultPackage = packaging.getPackageManager().assemble(session, opts, tmpFile);
return new FileVaultReplicationPackage(vaultPackage);
} catch (Exception e) {
throw new ReplicationPackageBuildingException(e);