X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fde%2Ftodesbaum%2Fjsite%2Fmain%2FCLI.java;h=9f0b2db3cb35226f24ecfdc056b37af2461717a6;hb=a0cf8264e9d97aeaefa3f6322d32f9b4b87f7559;hp=0cf9cc4ad1838a60359a57cb30b33f796e9fccc1;hpb=fbfe4707a1e3e9f23c8e1904d1a0eb0c3fbf587f;p=jSite.git diff --git a/src/main/java/de/todesbaum/jsite/main/CLI.java b/src/main/java/de/todesbaum/jsite/main/CLI.java index 0cf9cc4..9f0b2db 100644 --- a/src/main/java/de/todesbaum/jsite/main/CLI.java +++ b/src/main/java/de/todesbaum/jsite/main/CLI.java @@ -19,6 +19,7 @@ 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; @@ -50,7 +51,7 @@ public class CLI implements InsertListener { private Node[] nodes; /** The projects. */ - private Project[] projects; + private List projects; /** Whether the insert has finished. */ private boolean finished = false; @@ -220,6 +221,7 @@ public class CLI implements InsertListener { projectInserter.setProject(currentProject); projectInserter.start(new ProgressListener() { + @Override public void onProgress(long copied, long length) { System.out.print("Uploaded: " + copied + " / " + length + " bytes...\r"); } @@ -243,6 +245,7 @@ public class CLI implements InsertListener { /** * {@inheritDoc} */ + @Override public void projectInsertStarted(Project project) { outputWriter.println("Starting Insert of project \"" + project.getName() + "\"."); } @@ -250,6 +253,7 @@ public class CLI implements InsertListener { /** * {@inheritDoc} */ + @Override public void projectUploadFinished(Project project) { outputWriter.println("Project \"" + project.getName() + "\" has been uploaded, starting insert..."); } @@ -257,6 +261,7 @@ public class CLI implements InsertListener { /** * {@inheritDoc} */ + @Override public void projectURIGenerated(Project project, String uri) { outputWriter.println("URI: " + uri); } @@ -264,6 +269,7 @@ public class CLI implements InsertListener { /** * {@inheritDoc} */ + @Override public void projectInsertProgress(Project project, int succeeded, int failed, int fatal, int total, boolean finalized) { outputWriter.println("Progress: " + succeeded + " done, " + failed + " failed, " + fatal + " fatal, " + total + " total" + (finalized ? " (finalized)" : "") + ", " + ((succeeded + failed + fatal) * 100 / total) + "%"); } @@ -271,6 +277,7 @@ public class CLI implements InsertListener { /** * {@inheritDoc} */ + @Override public void projectInsertFinished(Project project, boolean success, Throwable cause) { outputWriter.println("Request URI: " + project.getFinalRequestURI(0)); finished = true;