}
String nextPhase = phases[i + 1];
String newResourcePath = "/" + nextPhase + originalPath;
repository.copy(new ResourcePath(resource.getPath()), new ResourcePath(newResourcePath));
Resource newResource = repository.get(newResourcePath);
newResource.setProperty(PHASE_PROPERTY, nextPhase);
repository.put(newResourcePath, newResource);
}