From 01c09a2bd361351f8e1a440a38190201784e9c8a Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 18 Mar 2012 02:13:50 +0100 Subject: [PATCH] Make the insert priority configurable. --- src/de/todesbaum/jsite/application/ProjectInserter.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/de/todesbaum/jsite/application/ProjectInserter.java b/src/de/todesbaum/jsite/application/ProjectInserter.java index 7c7c89c..70b485e 100644 --- a/src/de/todesbaum/jsite/application/ProjectInserter.java +++ b/src/de/todesbaum/jsite/application/ProjectInserter.java @@ -43,6 +43,7 @@ import de.todesbaum.util.freenet.fcp2.Connection; import de.todesbaum.util.freenet.fcp2.DirectFileEntry; import de.todesbaum.util.freenet.fcp2.FileEntry; import de.todesbaum.util.freenet.fcp2.Message; +import de.todesbaum.util.freenet.fcp2.PriorityClass; import de.todesbaum.util.freenet.fcp2.RedirectFileEntry; import de.todesbaum.util.freenet.fcp2.Verbosity; import de.todesbaum.util.io.StreamCopier.ProgressListener; @@ -93,6 +94,9 @@ public class ProjectInserter implements FileScannerListener, Runnable { /** Whether to use “early encode.” */ private boolean useEarlyEncode; + /** The insert priority. */ + private PriorityClass priority; + /** * Adds a listener to the list of registered listeners. * @@ -230,6 +234,16 @@ public class ProjectInserter implements FileScannerListener, Runnable { } /** + * Sets the insert priority. + * + * @param priority + * The insert priority + */ + public void setPriority(PriorityClass priority) { + this.priority = priority; + } + + /** * Starts the insert. * * @param progressListener @@ -420,6 +434,7 @@ public class ProjectInserter implements FileScannerListener, Runnable { putDir.setVerbosity(Verbosity.ALL); putDir.setMaxRetries(-1); putDir.setEarlyEncode(useEarlyEncode); + putDir.setPriorityClass(priority); putDir.setManifestPutter(ManifestPutter.DEFAULT); for (ScannedFile file : files) { FileEntry fileEntry = createFileEntry(file, edition); -- 2.7.4