URL url = projectDir.toURL();
URLResource res = new URLResource(url);
ProjectSaver saver = getApplication().getInjector().getInstance(
ProjectSaver.class);
boolean isNewProject = p.getConfigurationResource() == null;
Preferences tempOldPref = null;
if (isNewProject) {
tempOldPref = getApplication().getMainPreferenceForProject();
}
saver.saveAs(p, res);
if (oldPath != null
&& oldPath.length() != 0
&& !oldPath.equals(p.getConfigurationResource().getURL().getPath())) {