From: David ‘Bombe’ Roden Date: Sun, 18 Mar 2012 01:13:50 +0000 (+0100) Subject: Make the insert priority configurable. X-Git-Tag: 0.10-rc1~4 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=01c09a2bd361351f8e1a440a38190201784e9c8a;p=jSite.git Make the insert priority configurable. --- 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);