public class ConfigurationHelper {
public static void convertToContentPackageProject(IProject aContentProject,
IProgressMonitor monitor, IPath jcr_root) throws CoreException {
IProjectFacet slingContentFacet = ProjectFacetsManager.getProjectFacet("sling.content");
IFacetedProject fp2 = ProjectFacetsManager.create(aContentProject, true, null);
fp2.installProjectFacet(slingContentFacet.getLatestVersion(), null, null);
ProjectUtil.setSyncDirectoryPath(aContentProject, jcr_root);
aContentProject.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
}