Make manifest putter configurable.
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Thu, 22 Mar 2012 18:34:28 +0000 (19:34 +0100)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Thu, 22 Mar 2012 18:34:28 +0000 (19:34 +0100)
src/de/todesbaum/jsite/application/ProjectInserter.java

index 70b485e..d16be3e 100644 (file)
@@ -97,6 +97,9 @@ public class ProjectInserter implements FileScannerListener, Runnable {
        /** The insert priority. */
        private PriorityClass priority;
 
+       /** The manifest putter. */
+       private ManifestPutter manifestPutter;
+
        /**
         * Adds a listener to the list of registered listeners.
         *
@@ -244,6 +247,16 @@ public class ProjectInserter implements FileScannerListener, Runnable {
        }
 
        /**
+        * Sets the manifest putter to use for inserts.
+        *
+        * @param manifestPutter
+        *            The manifest putter to use
+        */
+       public void setManifestPutter(ManifestPutter manifestPutter) {
+               this.manifestPutter = manifestPutter;
+       }
+
+       /**
         * Starts the insert.
         *
         * @param progressListener
@@ -435,7 +448,7 @@ public class ProjectInserter implements FileScannerListener, Runnable {
                putDir.setMaxRetries(-1);
                putDir.setEarlyEncode(useEarlyEncode);
                putDir.setPriorityClass(priority);
-               putDir.setManifestPutter(ManifestPutter.DEFAULT);
+               putDir.setManifestPutter(manifestPutter);
                for (ScannedFile file : files) {
                        FileEntry fileEntry = createFileEntry(file, edition);
                        if (fileEntry != null) {