/*
- * jSite - CLI.java - Copyright © 2006–2012 David Roden
+ * jSite - CLI.java - Copyright © 2006–2014 David Roden
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
package de.todesbaum.jsite.main;
import java.io.PrintWriter;
+import java.util.List;
import net.pterodactylus.util.io.StreamCopier.ProgressListener;
import de.todesbaum.jsite.application.Freenet7Interface;
import de.todesbaum.jsite.application.Node;
import de.todesbaum.jsite.application.Project;
import de.todesbaum.jsite.application.ProjectInserter;
+import de.todesbaum.jsite.main.JarFileLocator.DefaultJarFileLocator;
/**
* Command-line interface for jSite.
private Node[] nodes;
/** The projects. */
- private Project[] projects;
+ private List<Project> projects;
/** Whether the insert has finished. */
private boolean finished = false;
}
}
- ConfigurationLocator configurationLocator = new ConfigurationLocator();
+ ConfigurationLocator configurationLocator = new ConfigurationLocator(new DefaultJarFileLocator(getClass().getClassLoader()));
if (configFile != null) {
configurationLocator.setCustomLocation(configFile);
}
freenetInterface.setNode(node);
projectInserter.setFreenetInterface(freenetInterface);
+ projectInserter.setPriority(configuration.getPriority());
Project currentProject = null;
for (String argument : args) {
*/
@Override
public void projectInsertProgress(Project project, int succeeded, int failed, int fatal, int total, boolean finalized) {
+ if (total == 0) {
+ return;
+ }
outputWriter.println("Progress: " + succeeded + " done, " + failed + " failed, " + fatal + " fatal, " + total + " total" + (finalized ? " (finalized)" : "") + ", " + ((succeeded + failed + fatal) * 100 / total) + "%");
}