It was removed from Freenet in August 2014.
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;
/** The insert priority. */
private PriorityClass priority;
- /** The manifest putter. */
- private ManifestPutter manifestPutter;
-
/**
* Adds a listener to the list of registered listeners.
*
}
/**
- * 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
putDir.setMaxRetries(-1);
putDir.setEarlyEncode(useEarlyEncode);
putDir.setPriorityClass(priority);
- putDir.setManifestPutter(manifestPutter);
for (ScannedFile file : files) {
FileEntry fileEntry = createFileEntry(file);
if (fileEntry != null) {
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;
/** The insert priority select box. */
private JComboBox insertPriorityComboBox;
- /** The manifest putter select box. */
- private JComboBox manifestPutterComboBox;
-
/**
* Creates a new “preferences” page.
*
}
/**
- * 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
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() {
/**
configurationDirectoryLabel.setText("<html><b>" + I18n.getMessage("jsite.preferences.config-directory") + "</b></html>");
insertOptionsLabel.setText("<html><b>" + I18n.getMessage("jsite.preferences.insert-options") + "</b></html>");
insertPriorityLabel.setText(I18n.getMessage("jsite.preferences.insert-options.priority"));
- manifestPutterLabel.setText(I18n.getMessage("jsite.preferences.insert-options.manifest-putter"));
}
});
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;
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
//
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;
/**
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;
- }
-
}
((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);
projectInsertPage.setTempDirectory(tempDirectory);
projectInsertPage.setUseEarlyEncode(configuration.useEarlyEncode());
projectInsertPage.setPriority(configuration.getPriority());
- projectInsertPage.setManifestPutter(configuration.getManifestPutter());
projectInsertPage.startInsert();
nodeMenu.setEnabled(false);
optionsPreferencesAction.setEnabled(false);
optionsPreferencesAction.setEnabled(true);
configuration.setUseEarlyEncode(preferencesPage.useEarlyEncode());
configuration.setPriority(preferencesPage.getPriority());
- configuration.setManifestPutter(preferencesPage.getManifestPutter());
configuration.setConfigurationLocation(preferencesPage.getConfigurationLocation());
}
}
*/
public class ClientPutDir<C extends 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.
*
}
/**
- * 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
super.write(writer);
if (defaultName != null)
writer.write("DefaultName=" + defaultName + LINEFEED);
- if (manifestPutter != null) {
- writer.write("ManifestPutter=" + manifestPutter.getName() + LINEFEED);
- }
}
}