in org.apache.ivyde.eclipse/src/java/org/apache/ivyde/internal/eclipse/cpcontainer/IvyClasspathContainerConfAdapter.java [107:274]
private static void loadV1(IvyClasspathContainerConfiguration conf, IPath path) {
SettingsSetup settingsSetup = conf.getIvySettingsSetup();
ClasspathSetup classpathSetup = conf.getClasspathSetup();
MappingSetup mappingSetup = conf.getMappingSetup();
AdvancedSetup advancedSetup = conf.getAdvancedSetup();
conf.setAdvancedProjectSpecific(false);
conf.setSettingsProjectSpecific(false);
String ivyXmlPath = "ivy.xml";
boolean doStandaloneRetrieve = false;
boolean isRetrieveProjectSpecific = false;
RetrieveSetup standaloneRetrieveSetup = new RetrieveSetup();
for (String keyValue : path.segment(1).substring(1).split("&")) {
String[] parameter = keyValue.split("=");
if (parameter == null || parameter.length == 0) {
continue;
}
String value;
try {
value = parameter.length > 1 ? URLDecoder.decode(parameter[1], "UTF-8") : "";
} catch (UnsupportedEncodingException e) {
// this should never never happen
IvyPlugin.logError(UTF8_ERROR, e);
throw new RuntimeException(UTF8_ERROR, e);
}
switch (parameter[0]) {
case "project":
if (conf.getJavaProject() == null && value.trim().length() != 0) {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IProject project = root.getProject(value.trim());
IJavaProject javaProject = JavaCore.create(project);
conf.setProject(javaProject);
}
break;
case "ivyXmlPath":
ivyXmlPath = value;
conf.setIvyXmlPath(value);
break;
case "confs":
List<String> confs = IvyClasspathUtil.split(value);
if (confs.isEmpty()) {
confs = Collections.singletonList("*");
}
conf.setConfs(confs);
break;
case "ivySettingsPath":
settingsSetup.setIvySettingsPath(readOldSettings(conf, value));
conf.setSettingsProjectSpecific(true);
break;
case "loadSettingsOnDemand":
settingsSetup.setLoadSettingsOnDemand(Boolean.valueOf(value));
conf.setSettingsProjectSpecific(true);
break;
case "ivyUserDir":
settingsSetup.setIvyUserDir(value);
conf.setSettingsProjectSpecific(true);
break;
case "propertyFiles":
settingsSetup.setPropertyFiles(IvyClasspathUtil.split(value));
conf.setSettingsProjectSpecific(true);
break;
case "acceptedTypes":
classpathSetup.setAcceptedTypes(IvyClasspathUtil.split(value));
conf.setClassthProjectSpecific(true);
break;
case "sourceTypes":
mappingSetup.setSourceTypes(IvyClasspathUtil.split(value));
conf.setMappingProjectSpecific(true);
break;
case "javadocTypes":
mappingSetup.setJavadocTypes(IvyClasspathUtil.split(value));
conf.setMappingProjectSpecific(true);
break;
case "sourceSuffixes":
mappingSetup.setSourceSuffixes(IvyClasspathUtil.split(value));
conf.setMappingProjectSpecific(true);
break;
case "javadocSuffixes":
mappingSetup.setJavadocSuffixes(IvyClasspathUtil.split(value));
conf.setMappingProjectSpecific(true);
break;
case "alphaOrder":
// if the value is not actually "true" or "false", the Boolean class ensure to
// return false, so it is fine
classpathSetup.setAlphaOrder(Boolean.valueOf(value));
conf.setClassthProjectSpecific(true);
break;
case "resolveInWorkspace":
classpathSetup.setResolveInWorkspace(Boolean.valueOf(value));
conf.setClassthProjectSpecific(true);
break;
case "transitiveResolve":
classpathSetup.setTransitiveResolve(Boolean.valueOf(value));
conf.setClassthProjectSpecific(true);
break;
case "readOSGiMetadata":
classpathSetup.setReadOSGiMetadata(Boolean.valueOf(value));
conf.setClassthProjectSpecific(true);
break;
case "resolveBeforeLaunch":
advancedSetup.setResolveBeforeLaunch(Boolean.valueOf(value));
conf.setAdvancedProjectSpecific(true);
break;
case "retrievedClasspath":
classpathSetup.setRetrievedClasspath(Boolean.valueOf(value));
conf.setClassthProjectSpecific(true);
break;
case "retrievedClasspathPattern":
classpathSetup.getRetrieveSetup().setRetrievePattern(value);
conf.setClassthProjectSpecific(true);
break;
case "retrievedClasspathSync":
classpathSetup.getRetrieveSetup().setRetrieveSync(Boolean.valueOf(value));
conf.setClassthProjectSpecific(true);
break;
case "retrievedClasspathTypes":
classpathSetup.getRetrieveSetup().setRetrieveTypes(value);
conf.setClassthProjectSpecific(true);
break;
case "mapIfOnlyOneSource":
mappingSetup.setMapIfOnlyOneSource(Boolean.valueOf(value));
conf.setMappingProjectSpecific(true);
break;
case "mapIfOnlyOneJavadoc":
mappingSetup.setMapIfOnlyOneJavadoc(Boolean.valueOf(value));
conf.setMappingProjectSpecific(true);
break;
// the following is the retrieve conf pre -IVYDE-56
// from this conf should be build StandaloneRetrieveSetup
case "doRetrieve":
// if the value is not actually "true" or "false", the Boolean class ensure to
// return false, so it is fine
doStandaloneRetrieve = Boolean.valueOf(value);
isRetrieveProjectSpecific = true;
break;
case "retrievePattern":
standaloneRetrieveSetup.setRetrievePattern(value);
isRetrieveProjectSpecific = true;
break;
case "retrieveSync":
standaloneRetrieveSetup.setRetrieveSync(Boolean.valueOf(value));
isRetrieveProjectSpecific = true;
break;
case "retrieveConfs":
standaloneRetrieveSetup.setRetrieveConfs(value);
isRetrieveProjectSpecific = true;
break;
case "retrieveTypes":
standaloneRetrieveSetup.setRetrieveTypes(value);
isRetrieveProjectSpecific = true;
break;
case "useExtendedResolveId":
advancedSetup.setUseExtendedResolveId(Boolean.valueOf(value));
conf.setAdvancedProjectSpecific(true);
break;
}
}
if (conf.isAdvancedProjectSpecific()) {
// in this V1 version, it is just some paranoid check
checkNonNullConf(conf);
}
// convert pre IVYDE-56 conf
convertOldRetrieveConf(conf, isRetrieveProjectSpecific, doStandaloneRetrieve,
standaloneRetrieveSetup, settingsSetup, ivyXmlPath);
}