From: David ‘Bombe’ Roden Date: Mon, 20 Jul 2015 09:27:13 +0000 (+0200) Subject: Remove manifest putter selection X-Git-Tag: 0.13^2~24 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=f936411037a6ec1afbc5efbb17dc9b0136adda76;p=jSite.git Remove manifest putter selection It was removed from Freenet in August 2014. --- diff --git a/src/main/java/de/todesbaum/jsite/application/ProjectInserter.java b/src/main/java/de/todesbaum/jsite/application/ProjectInserter.java index 35a2452..1504a9f 100644 --- a/src/main/java/de/todesbaum/jsite/application/ProjectInserter.java +++ b/src/main/java/de/todesbaum/jsite/application/ProjectInserter.java @@ -43,7 +43,6 @@ import de.todesbaum.jsite.gui.FileScanner.ScannedFile; import de.todesbaum.jsite.gui.FileScannerListener; import de.todesbaum.util.freenet.fcp2.Client; import de.todesbaum.util.freenet.fcp2.ClientPutComplexDir; -import de.todesbaum.util.freenet.fcp2.ClientPutDir.ManifestPutter; import de.todesbaum.util.freenet.fcp2.Connection; import de.todesbaum.util.freenet.fcp2.DirectFileEntry; import de.todesbaum.util.freenet.fcp2.FileEntry; @@ -100,9 +99,6 @@ 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. * @@ -166,16 +162,6 @@ 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 @@ -377,7 +363,6 @@ public class ProjectInserter implements FileScannerListener, Runnable { putDir.setMaxRetries(-1); putDir.setEarlyEncode(useEarlyEncode); putDir.setPriorityClass(priority); - putDir.setManifestPutter(manifestPutter); for (ScannedFile file : files) { FileEntry fileEntry = createFileEntry(file); if (fileEntry != null) { diff --git a/src/main/java/de/todesbaum/jsite/gui/PreferencesPage.java b/src/main/java/de/todesbaum/jsite/gui/PreferencesPage.java index 7cbeec6..5c4dcfa 100644 --- a/src/main/java/de/todesbaum/jsite/gui/PreferencesPage.java +++ b/src/main/java/de/todesbaum/jsite/gui/PreferencesPage.java @@ -40,7 +40,6 @@ import javax.swing.JTextField; import de.todesbaum.jsite.i18n.I18n; import de.todesbaum.jsite.i18n.I18nContainer; import de.todesbaum.jsite.main.ConfigurationLocator.ConfigurationLocation; -import de.todesbaum.util.freenet.fcp2.ClientPutDir.ManifestPutter; import de.todesbaum.util.freenet.fcp2.PriorityClass; import de.todesbaum.util.swing.TWizard; import de.todesbaum.util.swing.TWizardPage; @@ -112,9 +111,6 @@ public class PreferencesPage extends TWizardPage { /** The insert priority select box. */ private JComboBox insertPriorityComboBox; - /** The manifest putter select box. */ - private JComboBox manifestPutterComboBox; - /** * Creates a new “preferences” page. * @@ -266,25 +262,6 @@ public class PreferencesPage extends TWizardPage { } /** - * Returns the selected manifest putter. - * - * @return The selected manifest putter - */ - public ManifestPutter getManifestPutter() { - return (ManifestPutter) manifestPutterComboBox.getSelectedItem(); - } - - /** - * Sets the manifest putter. - * - * @param manifestPutter - * The manifest putter - */ - public void setManifestPutter(ManifestPutter manifestPutter) { - manifestPutterComboBox.setSelectedItem(manifestPutter); - } - - /** * {@inheritDoc} */ @Override @@ -466,12 +443,6 @@ public class PreferencesPage extends TWizardPage { insertPriorityComboBox.setAction(priorityAction); preferencesPanel.add(insertPriorityComboBox, new GridBagConstraints(1, 9, 2, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL, new Insets(0, 18, 0, 0), 0, 0)); - final JLabel manifestPutterLabel = new JLabel(I18n.getMessage("jsite.preferences.insert-options.manifest-putter")); - preferencesPanel.add(manifestPutterLabel, new GridBagConstraints(0, 10, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 18, 0, 0), 0, 0)); - - manifestPutterComboBox = new JComboBox(ManifestPutter.values()); - preferencesPanel.add(manifestPutterComboBox, new GridBagConstraints(1, 10, 2, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL, new Insets(0, 18, 0, 0), 0, 0)); - I18nContainer.getInstance().registerRunnable(new Runnable() { /** @@ -483,7 +454,6 @@ public class PreferencesPage extends TWizardPage { configurationDirectoryLabel.setText("" + I18n.getMessage("jsite.preferences.config-directory") + ""); insertOptionsLabel.setText("" + I18n.getMessage("jsite.preferences.insert-options") + ""); insertPriorityLabel.setText(I18n.getMessage("jsite.preferences.insert-options.priority")); - manifestPutterLabel.setText(I18n.getMessage("jsite.preferences.insert-options.manifest-putter")); } }); diff --git a/src/main/java/de/todesbaum/jsite/gui/ProjectInsertPage.java b/src/main/java/de/todesbaum/jsite/gui/ProjectInsertPage.java index f68144d..fd793ce 100644 --- a/src/main/java/de/todesbaum/jsite/gui/ProjectInsertPage.java +++ b/src/main/java/de/todesbaum/jsite/gui/ProjectInsertPage.java @@ -55,7 +55,6 @@ import de.todesbaum.jsite.application.Project; import de.todesbaum.jsite.application.ProjectInserter; import de.todesbaum.jsite.i18n.I18n; import de.todesbaum.jsite.i18n.I18nContainer; -import de.todesbaum.util.freenet.fcp2.ClientPutDir.ManifestPutter; import de.todesbaum.util.freenet.fcp2.PriorityClass; import de.todesbaum.util.swing.TWizard; import de.todesbaum.util.swing.TWizardPage; @@ -342,17 +341,6 @@ public class ProjectInsertPage extends TWizardPage implements InsertListener, Cl projectInserter.setPriority(priority); } - /** - * Sets the manifest putter to use for the insert. - * - * @see ProjectInserter#setManifestPutter(ManifestPutter) - * @param manifestPutter - * The manifest putter - */ - public void setManifestPutter(ManifestPutter manifestPutter) { - projectInserter.setManifestPutter(manifestPutter); - } - // // INTERFACE InsertListener // diff --git a/src/main/java/de/todesbaum/jsite/main/Configuration.java b/src/main/java/de/todesbaum/jsite/main/Configuration.java index 2a27e89..ea072d1 100644 --- a/src/main/java/de/todesbaum/jsite/main/Configuration.java +++ b/src/main/java/de/todesbaum/jsite/main/Configuration.java @@ -43,7 +43,6 @@ import de.todesbaum.jsite.application.FileOption; import de.todesbaum.jsite.application.Node; import de.todesbaum.jsite.application.Project; import de.todesbaum.jsite.main.ConfigurationLocator.ConfigurationLocation; -import de.todesbaum.util.freenet.fcp2.ClientPutDir.ManifestPutter; import de.todesbaum.util.freenet.fcp2.PriorityClass; /** @@ -623,25 +622,4 @@ public class Configuration { return this; } - /** - * Returns the manifest putter. - * - * @return The manifest putter - */ - public ManifestPutter getManifestPutter() { - return ManifestPutter.valueOf(getNodeValue(new String[] { "manifest-putter" }, "simple").toUpperCase()); - } - - /** - * Sets the manifest putter. - * - * @param manifestPutter - * The manifest putter - * @return This configuration - */ - public Configuration setManifestPutter(ManifestPutter manifestPutter) { - rootNode.replace("manifest-putter", manifestPutter.name().toLowerCase()); - return this; - } - } diff --git a/src/main/java/de/todesbaum/jsite/main/Main.java b/src/main/java/de/todesbaum/jsite/main/Main.java index 59a3116..60fb64a 100644 --- a/src/main/java/de/todesbaum/jsite/main/Main.java +++ b/src/main/java/de/todesbaum/jsite/main/Main.java @@ -483,7 +483,6 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen ((PreferencesPage) pages.get(PageType.PAGE_PREFERENCES)).setHasCustomConfiguration(configuration.getConfigurationLocator().isValidLocation(ConfigurationLocation.CUSTOM)); ((PreferencesPage) pages.get(PageType.PAGE_PREFERENCES)).setUseEarlyEncode(configuration.useEarlyEncode()); ((PreferencesPage) pages.get(PageType.PAGE_PREFERENCES)).setPriority(configuration.getPriority()); - ((PreferencesPage) pages.get(PageType.PAGE_PREFERENCES)).setManifestPutter(configuration.getManifestPutter()); showPage(PageType.PAGE_PREFERENCES); optionsPreferencesAction.setEnabled(false); wizard.setNextEnabled(true); @@ -588,7 +587,6 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen projectInsertPage.setTempDirectory(tempDirectory); projectInsertPage.setUseEarlyEncode(configuration.useEarlyEncode()); projectInsertPage.setPriority(configuration.getPriority()); - projectInsertPage.setManifestPutter(configuration.getManifestPutter()); projectInsertPage.startInsert(); nodeMenu.setEnabled(false); optionsPreferencesAction.setEnabled(false); @@ -607,7 +605,6 @@ public class Main implements ActionListener, ListSelectionListener, WizardListen optionsPreferencesAction.setEnabled(true); configuration.setUseEarlyEncode(preferencesPage.useEarlyEncode()); configuration.setPriority(preferencesPage.getPriority()); - configuration.setManifestPutter(preferencesPage.getManifestPutter()); configuration.setConfigurationLocation(preferencesPage.getConfigurationLocation()); } } diff --git a/src/main/java/de/todesbaum/util/freenet/fcp2/ClientPutDir.java b/src/main/java/de/todesbaum/util/freenet/fcp2/ClientPutDir.java index 386fe1d..4ea4b1d 100644 --- a/src/main/java/de/todesbaum/util/freenet/fcp2/ClientPutDir.java +++ b/src/main/java/de/todesbaum/util/freenet/fcp2/ClientPutDir.java @@ -30,66 +30,9 @@ import java.io.Writer; */ public class ClientPutDir> extends ClientPut { - /** - * All possible manifest putters. Manifest putters are used to distribute - * files of a directory insert to different containers, depending on size, - * type, and other factors. - * - * @author David ‘Bombe’ Roden <bombe@freenetproject.org> - */ - public enum ManifestPutter { - - /** - * Use the “simple” manifest putter. Despite its name this is currently - * the default manifest putter. - */ - SIMPLE("simple"), - - /** Use the “default” manifest putter. */ - DEFAULT("default"); - - /** The name of the manifest putter. */ - private final String name; - - /** - * Creates a new manifest putter. - * - * @param name - * The name of the manifest putter - */ - private ManifestPutter(String name) { - this.name = name; - } - - /** - * Returns the name of the manifest putter. - * - * @return The name of the manifest putter - */ - public String getName() { - return name; - } - - // - // OBJECT METHODS - // - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return name.substring(0, 1).toUpperCase() + name.substring(1); - } - - } - /** The default file of the directory. */ protected String defaultName; - /** The manifest putter to use. */ - private ManifestPutter manifestPutter; - /** * Creates a new request with the specified name, identifier, and URI. * @@ -128,30 +71,6 @@ public class ClientPutDir> extends ClientPut { } /** - * Returns the current manifest putter. - * - * @return The current manifest putter (may be {@code null}) - */ - public ManifestPutter getManifestPutter() { - return manifestPutter; - } - - /** - * Sets the manifest putter for the “ClientPutDir” command. If {@code null} - * is given the node will choose a manifest putter. - * - * @param manifestPutter - * The manifest putter to use for the command (may be - * {@code null}) - * @return This ClientPutDir command - */ - @SuppressWarnings("unchecked") - public C setManifestPutter(ManifestPutter manifestPutter) { - this.manifestPutter = manifestPutter; - return (C) this; - } - - /** * {@inheritDoc} */ @Override @@ -159,9 +78,6 @@ public class ClientPutDir> extends ClientPut { super.write(writer); if (defaultName != null) writer.write("DefaultName=" + defaultName + LINEFEED); - if (manifestPutter != null) { - writer.write("ManifestPutter=" + manifestPutter.getName() + LINEFEED); - } } }