private void doPrepare(InstallContext ctx) throws PackageException, RepositoryException {
// read the properties from the package
Properties props = ctx.getPackage().getMetaInf().getProperties();
String copyFrom = props.getProperty(PROP_COPY_FROM, "");
if (copyFrom.length() == 0) {
throw new PackageException("hook-example needs " + PROP_COPY_FROM + " property set in properties.xml");
}
String copyTo = props.getProperty(PROP_COPY_TO, "");
if (copyTo.length() == 0) {
throw new PackageException("hook-example needs " + PROP_COPY_TO + " property set in properties.xml");
}
testNodePath = props.getProperty(PROP_TEST_NODE, "");
if (testNodePath.length() == 0) {
throw new PackageException("hook-example needs " + PROP_TEST_NODE + " property set in properties.xml");
}
copyTo += "_" + System.currentTimeMillis();
ctx.getSession().getWorkspace().copy(copyFrom, copyTo);
log.info("hook-example copied {} to {}", copyFrom, copyTo);