X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fde%2Ftodesbaum%2Fjsite%2Fmain%2FCLI.java;h=7c1fb3d8371f798dff306d6d5415d19397e2dadf;hb=250630a5fb1ff745f05788210a6efd976533fb55;hp=c401aaae4384d45bac49f6477b8cb728c9889d15;hpb=6f1a8216cfba28add0ef365b46a08d16d4eb87fe;p=jSite.git diff --git a/src/de/todesbaum/jsite/main/CLI.java b/src/de/todesbaum/jsite/main/CLI.java index c401aaa..7c1fb3d 100644 --- a/src/de/todesbaum/jsite/main/CLI.java +++ b/src/de/todesbaum/jsite/main/CLI.java @@ -21,7 +21,6 @@ package de.todesbaum.jsite.main; 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; @@ -29,8 +28,7 @@ import de.todesbaum.jsite.application.Project; import de.todesbaum.jsite.application.ProjectInserter; /** - * @author David Roden <droden@gmail.com> - * @version $Id: CLI.java 418 2006-03-29 17:49:16Z bombe $ + * @author David ‘Bombe’ Roden <bombe@freenetproject.org> */ public class CLI implements InsertListener { @@ -75,8 +73,7 @@ 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); @@ -116,12 +113,7 @@ public class CLI implements InsertListener { 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; @@ -187,6 +179,10 @@ public class CLI implements InsertListener { outputWriter.println("Starting Insert of project \"" + project.getName() + "\"."); } + public void projectURIGenerated(Project project, String uri) { + outputWriter.println("URI: " + uri); + } + /** * {@inheritDoc} */ @@ -198,13 +194,8 @@ public class CLI implements InsertListener { * {@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();