import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import java.util.Map.Entry;
import java.util.Properties;
import java.util.Random;
import java.util.logging.Logger;
project.setPrivateKey(projectPrivateKey);
project.setPublicKey(projectPublicKey);
project.setBasePath(projectBasePath);
+ int overrideIndex = 0;
+ while (projectProperties.containsKey(projectPrefix + ".overrides." + overrideIndex)) {
+ String filePath = projectProperties.getProperty(projectPrefix + ".overrides." + overrideIndex + ".filePath");
+ Override override = Override.valueOf(projectProperties.getProperty(projectPrefix + ".overrides." + overrideIndex + ".override"));
+ project.addOverride(filePath, override);
+ overrideIndex++;
+ }
projects.add(project);
logger.fine("loaded project “" + project.getName() + "”.");
projectIndex++;
projectProperties.setProperty(projectPrefix + ".privateKey", project.getPrivateKey());
projectProperties.setProperty(projectPrefix + ".publicKey", project.getPublicKey());
projectProperties.setProperty(projectPrefix + ".basePath", project.getBasePath());
+ int overrideIndex = 0;
+ for (Entry<String, Override> overrideEntry: project.getOverrides().entrySet()) {
+ projectProperties.setProperty(projectPrefix + ".overrides." + overrideIndex + ".filePath", overrideEntry.getKey());
+ projectProperties.setProperty(projectPrefix + ".overrides." + overrideIndex + ".override", overrideEntry.getValue().toString());
+ overrideIndex++;
+ }
projectIndex++;
}
File projectFile = new File(directoryFile, "projects.properties");