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.Map.Entry;
+import java.util.logging.Level;
import java.util.logging.Logger;
import net.pterodactylus.jsite.core.JSiteException;
project.setBasePath(projectBasePath);
project.setDefaultFile(projectDefaultFile);
int overrideIndex = 0;
- while (projectProperties.containsKey(projectPrefix + ".overrides." + overrideIndex)) {
+ while (projectProperties.containsKey(projectPrefix + ".overrides." + overrideIndex + ".override")) {
String filePath = projectProperties.getProperty(projectPrefix + ".overrides." + overrideIndex + ".filePath");
FileOverride override = FileOverride.valueOf(projectProperties.getProperty(projectPrefix + ".overrides." + overrideIndex + ".override"));
project.addFileOverride(filePath, override);
+ logger.log(Level.FINEST, "read override: " + filePath + ", " + override);
overrideIndex++;
}
projects.add(project);
}
Properties projectProperties = new Properties();
int projectIndex = 0;
- for (Project project: projects) {
+ for (Project project : projects) {
String projectPrefix = "projects." + projectIndex;
projectProperties.setProperty(projectPrefix + ".id", project.getId());
projectProperties.setProperty(projectPrefix + ".name", project.getName());
projectProperties.setProperty(projectPrefix + ".basePath", project.getBasePath());
projectProperties.setProperty(projectPrefix + ".defaultFile", project.getDefaultFile());
int overrideIndex = 0;
- for (Entry<String, FileOverride> overrideEntry: project.getFileOverrides().entrySet()) {
+ for (Entry<String, FileOverride> overrideEntry : project.getFileOverrides().entrySet()) {
projectProperties.setProperty(projectPrefix + ".overrides." + overrideIndex + ".filePath", overrideEntry.getKey());
projectProperties.setProperty(projectPrefix + ".overrides." + overrideIndex + ".override", overrideEntry.getValue().toString());
overrideIndex++;