import java.io.PrintWriter;
-import de.todesbaum.jsite.application.EditionProject;
import de.todesbaum.jsite.application.Freenet7Interface;
import de.todesbaum.jsite.application.InsertListener;
import de.todesbaum.jsite.application.Node;
/**
* @author David Roden <droden@gmail.com>
- * @version $Id: CLI.java 418 2006-03-29 17:49:16Z bombe $
+ * @version $Id$
*/
public class CLI implements InsertListener {
projectInserter.setFreenetInterface(freenetInterface);
Project currentProject = null;
- for (int argumentIndex = 0, argumentSize = args.length; argumentIndex < argumentSize; argumentIndex++) {
- String argument = args[argumentIndex];
+ for (String argument: args) {
String value = argument.substring(argument.indexOf('=') + 1).trim();
if (argument.startsWith("--node=")) {
Node newNode = getNode(value);
outputWriter.println("You can't specify --edition before --project.");
return;
}
- if (currentProject instanceof EditionProject) {
- ((EditionProject) currentProject).setEdition(Integer.parseInt(value));
- } else {
- outputWriter.println("Project \"" + currentProject.getName() + "\" is not an edition-based project.");
- return;
- }
+ currentProject.setEdition(Integer.parseInt(value));
} else {
outputWriter.println("Unknown parameter: " + argument);
return;
outputWriter.println("Starting Insert of project \"" + project.getName() + "\".");
}
+ public void projectURIGenerated(Project project, String uri) {
+ outputWriter.println("URI: " + uri);
+ }
+
/**
* {@inheritDoc}
*/
* {@inheritDoc}
*/
public void projectInsertFinished(Project project, boolean success, Throwable cause) {
- outputWriter.println("Request URI: " + project.getFinalURI(0));
+ outputWriter.println("Request URI: " + project.getFinalRequestURI(0));
finished = true;
- if (success) {
- if (project instanceof EditionProject) {
- ((EditionProject) project).setEdition(((EditionProject) project).getEdition() + 1);
- }
- }
this.success = success;
synchronized (lockObject) {
lockObject.notify();