* currently the only project type.
*
* @author David Roden <droden@gmail.com>
- * @version $Id: EditionProject.java 417 2006-03-29 12:36:54Z bombe $
+ * @version $Id$
*/
public class EditionProject extends Project {
* @return The final request URI
*/
@Override
- public String getFinalURI(int editionOffset) {
- return requestURI + path + "-" + (edition + editionOffset) + "/";
+ public String getFinalRequestURI(int offset) {
+ return "freenet:USK@" + requestURI + "/" + path + "/" + (edition + offset) + "/";
}
}
insert = DEFAULT_INSERT;
customKey = DEFAULT_CUSTOM_KEY;
this.defaultMimeType = defaultMimeType;
- this.mimeType = defaultMimeType;
- this.container = DEFAULT_CONTAINER;
- this.editionRange = DEFAULT_EDITION_RANGE;
- this.replaceEdition = DEFAULT_REPLACE_EDITION;
+ mimeType = defaultMimeType;
+ container = DEFAULT_CONTAINER;
+ editionRange = DEFAULT_EDITION_RANGE;
+ replaceEdition = DEFAULT_REPLACE_EDITION;
}
/**
}
public boolean isCustom() {
- if (insert != DEFAULT_INSERT)
+ if (insert != DEFAULT_INSERT) {
return true;
- if (!customKey.equals(DEFAULT_CUSTOM_KEY))
+ }
+ if (!customKey.equals(DEFAULT_CUSTOM_KEY)) {
return true;
- if (!defaultMimeType.equals(mimeType))
+ }
+ if (!defaultMimeType.equals(mimeType)) {
return true;
- if (!DEFAULT_CONTAINER.equals(container))
+ }
+ if (!DEFAULT_CONTAINER.equals(container)) {
return true;
- if (replaceEdition != DEFAULT_REPLACE_EDITION)
+ }
+ if (replaceEdition != DEFAULT_REPLACE_EDITION) {
return true;
- if (editionRange != DEFAULT_EDITION_RANGE)
+ }
+ if (editionRange != DEFAULT_EDITION_RANGE) {
return true;
+ }
return false;
}
/**
* @author David Roden <droden@gmail.com>
- * @version $Id: Freenet7Interface.java 418 2006-03-29 17:49:16Z bombe $
+ * @version $Id$
*/
public class Freenet7Interface {
/**
* @author David Roden <droden@gmail.com>
- * @version $Id: InsertListener.java 397 2006-03-25 16:11:34Z bombe $
+ * @version $Id$
*/
public interface InsertListener extends EventListener {
}
public void projectInsertStarted(Project project);
+ public void projectURIGenerated(Project project, String uri);
public void projectInsertProgress(Project project, int succeeded, int failed, int fatal, int total, boolean finalized);
/**
* @author David Roden <droden@gmail.com>
- * @version $Id: Node.java 419 2006-03-29 17:49:46Z bombe $
+ * @version $Id$
*/
public class Node extends de.todesbaum.util.freenet.fcp2.Node {
this.port = port;
}
+ @Override
public boolean equals(Object o) {
if ((o == null) || !(o instanceof Node)) {
return false;
return name.equals(node.name) && hostname.equals(node.hostname) && (port == node.port);
}
+ @Override
public int hashCode() {
return name.hashCode() ^ hostname.hashCode() ^ port;
}
+ @Override
public String toString() {
return name + " (" + hostname + ":" + port + ")";
}
/**
* @author David Roden <dr@todesbaum.dyndns.org>
- * @version $Id: Project.java 357 2006-03-24 15:46:03Z bombe $
+ * @version $Id$
*/
public abstract class Project implements Comparable {
* The title to set.
*/
public void setName(String title) {
- this.name = title;
+ name = title;
}
/**
* The lastInserted to set.
*/
public void setLastInsertionTime(long lastInserted) {
- this.lastInsertionTime = lastInserted;
+ lastInsertionTime = lastInserted;
}
/**
* The name to set.
*/
public void setPath(String name) {
- this.path = name;
+ path = name;
}
/**
* The insertURI to set.
*/
public void setInsertURI(String insertURI) {
- this.insertURI = insertURI;
+ this.insertURI = shortenURI(insertURI);
}
/**
* The requestURI to set.
*/
public void setRequestURI(String requestURI) {
- this.requestURI = requestURI;
+ this.requestURI = shortenURI(requestURI);
}
+ @Override
public String toString() {
return name;
}
+
+ private String shortenURI(String uri) {
+ if (uri.startsWith("freenet:")) {
+ uri = uri.substring("freenet:".length());
+ }
+ if (uri.startsWith("SSK@")) {
+ uri = uri.substring("SSK@".length());
+ }
+ if (uri.endsWith("/")) {
+ uri = uri.substring(0, uri.length() - 1);
+ }
+ return uri;
+ }
public String shortenFilename(File file) {
String filename = file.getPath();
}
public void setFileOption(String filename, FileOption fileOption) {
- fileOptions.put(filename, fileOption);
+ if (fileOption != null) {
+ fileOptions.put(filename, fileOption);
+ } else {
+ fileOptions.remove(filename);
+ }
}
/**
* @return Returns the fileOptions.
*/
public Map<String, FileOption> getFileOptions() {
- return Collections.unmodifiableMap(fileOptions);
+ return Collections.unmodifiableMap(new HashMap<String, FileOption>(fileOptions));
}
/**
this.fileOptions.clear();
this.fileOptions.putAll(fileOptions);
}
-
- public String getFinalURI(int editionOffset) {
- return requestURI + path + "/";
+
+ public String getFinalRequestURI(int offset) {
+ return "freenet:USK@" + requestURI + "/" + path + "/";
}
/**
/**
* @author David Roden <droden@gmail.com>
- * @version $Id: ProjectInserter.java 486 2006-04-27 10:58:34Z bombe $
+ * @version $Id$
*/
public class ProjectInserter implements FileScannerListener, Runnable {
insertListener.projectInsertStarted(project);
}
}
+
+ protected void fireProjectURIGenerated(String uri) {
+ for (InsertListener insertListener: insertListeners) {
+ insertListener.projectURIGenerated(project, uri);
+ }
+ }
protected void fireProjectInsertProgress(int succeeded, int failed, int fatal, int total, boolean finalized) {
for (InsertListener insertListener: insertListeners) {
ByteArrayOutputStream filteredByteOutputStream = new ByteArrayOutputStream(Math.min(Integer.MAX_VALUE, (int) length[0]));
ReplacingOutputStream outputStream = new ReplacingOutputStream(filteredByteOutputStream);
FileInputStream fileInput = new FileInputStream(file);
- outputStream.addReplacement("$[CONTAINER]", "/");
outputStream.addReplacement("$[EDITION]", String.valueOf(edition));
- outputStream.addReplacement("$[URI]", project.getFinalURI(0));
+ outputStream.addReplacement("$[URI]", project.getFinalRequestURI(0));
for (int index = 1; index <= fileOption.getEditionRange(); index++) {
- outputStream.addReplacement("$[URI+" + index + "]", project.getFinalURI(index));
+ outputStream.addReplacement("$[URI+" + index + "]", project.getFinalRequestURI(index));
outputStream.addReplacement("$[EDITION+" + index + "]", String.valueOf(edition + index));
}
StreamCopier.copy(fileInput, outputStream, length[0]);
/* collect files */
int edition = ((EditionProject) project).getEdition();
- String dirURI = project.getInsertURI() + project.getPath() + "-" + edition;
+ String dirURI = "freenet:USK@" + project.getInsertURI() + "/" + project.getPath() + "/" + edition + "/";
ClientPutComplexDir putDir = new ClientPutComplexDir("dir-" + counter++, dirURI);
putDir.setDefaultName(project.getIndexFile());
putDir.setVerbosity(Verbosity.ALL);
}
/* parse progress and success messages */
- boolean success = true;
+ boolean success = false;
boolean finished = false;
boolean disconnected = false;
while (!finished) {
Message message = client.readMessage();
- finished = (message == null) && (disconnected = client.isDisconnected());
+ finished = (message == null) || (disconnected = client.isDisconnected());
if (debug) {
System.out.println(message);
}
if (!finished) {
String messageName = message.getName();
+ if ("URIGenerated".equals(messageName)) {
+ fireProjectURIGenerated(message.get("URI"));
+ }
if ("SimpleProgress".equals(messageName)) {
int total = Integer.parseInt(message.get("Total"));
int succeeded = Integer.parseInt(message.get("Succeeded"));
/**
* @author David Roden <droden@gmail.com>
- * @version $Id: NodeManagerListener.java 418 2006-03-29 17:49:16Z bombe $
+ * @version $Id$
*/
public interface NodeManagerListener extends EventListener {
/**
* @author David Roden <droden@gmail.com>
- * @version $Id: NodeManagerPage.java 418 2006-03-29 17:49:16Z bombe $
+ * @version $Id$
*/
public class NodeManagerPage extends TWizardPage implements ListSelectionListener, DocumentListener, ChangeListener {
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.Iterator;
import java.util.List;
import javax.swing.AbstractAction;
/**
* @author David Roden <droden@gmail.com>
- * @version $Id: ProjectFilesPage.java 404 2006-03-26 02:11:03Z bombe $
+ * @version $Id$
*/
public class ProjectFilesPage extends TWizardPage implements ActionListener, ListSelectionListener, DocumentListener, FileScannerListener, ChangeListener {
deleteContainerAction.setEnabled(false);
}
+ @Override
public void pageAdded(TWizard wizard) {
this.wizard = wizard;
actionScan();
rebuildContainerComboBox();
}
});
+ Iterator<String> filenames = project.getFileOptions().keySet().iterator();
+ while (filenames.hasNext()) {
+ String filename = filenames.next();
+ if (!files.contains(filename)) {
+ project.setFileOption(filename, null);
+ }
+ }
} else {
JOptionPane.showMessageDialog(wizard, I18n.getMessage("jsite.project-files.scan-error"), null, JOptionPane.ERROR_MESSAGE);
}
private void processDocumentUpdate(DocumentEvent documentEvent) {
String filename = (String) projectFileList.getSelectedValue();
- if (filename == null)
+ if (filename == null) {
return;
+ }
FileOption fileOption = project.getFileOption(filename);
Document document = documentEvent.getDocument();
try {
*/
public void stateChanged(ChangeEvent changeEvent) {
String filename = (String) projectFileList.getSelectedValue();
- if (filename == null)
+ if (filename == null) {
return;
+ }
FileOption fileOption = project.getFileOption(filename);
Object source = changeEvent.getSource();
if (source instanceof JSpinner) {
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
-import de.todesbaum.jsite.application.EditionProject;
import de.todesbaum.jsite.application.Freenet7Interface;
import de.todesbaum.jsite.application.InsertListener;
import de.todesbaum.jsite.application.Project;
/**
* @author David Roden <droden@gmail.com>
- * @version $Id: ProjectInsertPage.java 408 2006-03-29 09:31:10Z bombe $
+ * @version $Id$
*/
public class ProjectInsertPage extends TWizardPage implements InsertListener {
requestURITextField = new JTextField();
requestURITextField.setEditable(false);
- requestURITextField.setBackground(getBackground());
- requestURITextField.setBorder(null);
startTimeLabel = new JLabel();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
- StringBuffer uriBuffer = new StringBuffer();
- uriBuffer.append(project.getRequestURI());
- uriBuffer.append(project.getPath());
- if (project instanceof EditionProject) {
- uriBuffer.append('-').append(((EditionProject) project).getEdition());
- }
- uriBuffer.append('/');
- requestURITextField.setText(uriBuffer.toString());
+ requestURITextField.setText(project.getFinalRequestURI(0));
}
});
}
-
+
public void setFreenetInterface(Freenet7Interface freenetInterface) {
projectInserter.setFreenetInterface(freenetInterface);
}
}
});
}
+
+ /**
+ * {@inheritDoc}
+ */
+ public void projectURIGenerated(Project project, final String uri) {
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ requestURITextField.setText(uri);
+ }
+ });
+ }
/**
* {@inheritDoc}
/**
* @author David Roden <droden@gmail.com>
- * @version $Id: ProjectPage.java 418 2006-03-29 17:49:16Z bombe $
+ * @version $Id$
*/
public class ProjectPage extends TWizardPage implements ListSelectionListener, ChangeListener, DocumentListener {
private JTextField projectPublicKeyTextField;
private JTextField projectPrivateKeyTextField;
private JTextField projectPathTextField;
- private JSpinner projectEditionSpinner;
public ProjectPage() {
super();
informationTable.add(new TLabel(I18n.getMessage("jsite.project.project.path") + ":", KeyEvent.VK_P, projectPathTextField), new GridBagConstraints(0, 7, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 18, 0, 0), 0, 0));
informationTable.add(projectPathTextField, new GridBagConstraints(1, 7, 2, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(6, 6, 0, 0), 0, 0));
- projectEditionSpinner = new JSpinner(new SpinnerNumberModel(1, 0, Integer.MAX_VALUE, 1));
- ((NumberEditor) projectEditionSpinner.getEditor()).getTextField().setColumns(6);
- projectEditionSpinner.setName("project.edition");
- projectEditionSpinner.addChangeListener(this);
- projectEditionSpinner.setEnabled(false);
-
- informationTable.add(new TLabel(I18n.getMessage("jsite.project.project.edition") + ":", KeyEvent.VK_E, projectEditionSpinner), new GridBagConstraints(0, 8, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 18, 0, 0), 0, 0));
- informationTable.add(projectEditionSpinner, new GridBagConstraints(1, 8, 2, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(6, 6, 0, 0), 0, 0));
-
return informationPanel;
}
protected void actionLocalPathBrowse() {
Project project = (Project) projectList.getSelectedValue();
- if (project == null)
+ if (project == null) {
return;
+ }
pathChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
if (pathChooser.showDialog(this, I18n.getMessage("jsite.project.action.browse.choose")) == JFileChooser.APPROVE_OPTION) {
projectLocalPathTextField.setText(pathChooser.getSelectedFile().getPath());
projectPublicKeyTextField.setEnabled(selectedRow > -1);
projectPrivateKeyTextField.setEnabled(selectedRow > -1);
projectPathTextField.setEnabled(selectedRow > -1);
- projectEditionSpinner.setEnabled(selectedRow > -1);
projectLocalPathBrowseAction.setEnabled(selectedRow > -1);
projectDeleteAction.setEnabled(selectedRow > -1);
projectCloneAction.setEnabled(selectedRow > -1);
projectPathTextField.setText(selectedProject.getPath());
if (selectedProject instanceof EditionProject) {
EditionProject editionProject = (EditionProject) selectedProject;
- projectEditionSpinner.setValue(editionProject.getEdition());
}
} else {
projectNameTextField.setText("");
projectPublicKeyTextField.setText("");
projectPrivateKeyTextField.setText("");
projectPathTextField.setText("");
- projectEditionSpinner.setValue(0);
}
}
package de.todesbaum.jsite.i18n;
import java.util.Locale;
+import java.util.MissingResourceException;
import java.util.ResourceBundle;
/**
* @author David Roden <droden@gmail.com>
- * @version $Id: I18n.java 355 2006-03-24 15:04:11Z bombe $
+ * @version $Id$
*/
public class I18n {
+ private static Locale defaultLocale = new Locale("en");
private static Locale currentLocale;
public static Locale getLocale() {
- if (currentLocale == null)
+ if (currentLocale == null) {
currentLocale = Locale.getDefault();
+ }
return currentLocale;
}
}
public static String getMessage(String key) {
- return getResourceBundle().getString(key);
+ try {
+ return getResourceBundle().getString(key);
+ } catch (MissingResourceException mre1) {
+ return getResourceBundle(defaultLocale).getString(key);
+ }
}
}
jsite.project-files.no-node-running=<html><b>Node is not running</b><br><br>You can not insert a project if your node is not running.<br>Please start your node and try again.</html>
jsite.project-files.no-custom-key=<html><b>No custom key for file</b><br><br>You specified not to insert <code>{0}</code><br>but failed to enter a key to redirect to!</html>
jsite.project-files.no-node-selected=<html><b>No node selected</b><br><br>Please select a node from the menu!</html>
+jsite.project-files.insert-now=Insert now
jsite.project-files.no-node-running=<html><b>Der Node läuft nicht</b><br><br>Sie können das Projekt nicht einfügen, wenn<br>Ihr Node nicht läuft. Bitte starten Sie Ihren Node<br>und probieren Sie es erneut.</html>
jsite.project-files.no-custom-key=<html><b>Kein externer Schlüssel</b><br><br>Sie haben angegeben, dass die Datei <code>{0}</code><br>nicht eingefügt werden soll. Allerdings haben Sie<br>keinen extern erstellten Schlüssel angegeben.</html>
jsite.project-files.no-node-selected=<html><b>Kein Node ausgewählt</b><br><br>Bitte wählen Sie einen Node aus dem Menü!</html>
+jsite.project-files.insert-now=Jetzt einfügen
/**
* @author David Roden <droden@gmail.com>
- * @version $Id: CLI.java 418 2006-03-29 17:49:16Z bombe $
+ * @version $Id$
*/
public class CLI implements InsertListener {
projectInserter.setFreenetInterface(freenetInterface);
Project currentProject = null;
- for (int argumentIndex = 0, argumentSize = args.length; argumentIndex < argumentSize; argumentIndex++) {
- String argument = args[argumentIndex];
+ for (String argument: args) {
String value = argument.substring(argument.indexOf('=') + 1).trim();
if (argument.startsWith("--node=")) {
Node newNode = getNode(value);
outputWriter.println("Starting Insert of project \"" + project.getName() + "\".");
}
+ public void projectURIGenerated(Project project, String uri) {
+ outputWriter.println("URI: " + uri);
+ }
+
/**
* {@inheritDoc}
*/
* {@inheritDoc}
*/
public void projectInsertFinished(Project project, boolean success, Throwable cause) {
- outputWriter.println("Request URI: " + project.getFinalURI(0));
+ outputWriter.println("Request URI: " + project.getFinalRequestURI(0));
finished = true;
if (success) {
if (project instanceof EditionProject) {
/**
* @author David Roden <droden@gmail.com>
- * @version $Id: Configuration.java 418 2006-03-29 17:49:16Z bombe $
+ * @version $Id$
*/
public class Configuration {
* @return The hostname of the node
* @deprecated Use {@link #getSelectedNode()} instead
*/
+ @Deprecated
public String getNodeAddress() {
return getNodeValue(new String[] { "node-address" }, "localhost");
}
* @param nodeAddress The hostname of the node
* @deprecated Use {@link #setSelectedNode(Node)} instead
*/
+ @Deprecated
public void setNodeAddress(String nodeAddress) {
rootNode.replace("node-address", nodeAddress);
}
* @return The port number of the node
* @deprecated Use {@link #getSelectedNode()} instead.
*/
+ @Deprecated
public int getNodePort() {
return getNodeIntValue(new String[] { "node-port" }, 9481);
}
* @param nodePort The port number of the node
* @deprecated Use {@link #setSelectedNode(Node)} instead
*/
+ @Deprecated
public void setNodePort(int nodePort) {
rootNode.replace("node-port", String.valueOf(nodePort));
}
/**
* @author <a href="mailto:droden@gmail.com">David Roden </a>
- * @version $Id: Main.java 464 2006-04-04 21:53:33Z bombe $
+ * @version $Id$
*/
public class Main implements ActionListener, ListSelectionListener, WizardListener, NodeManagerListener {
((ProjectFilesPage) pages.get(PageType.PAGE_PROJECT_FILES)).setProject(project);
((ProjectInsertPage) pages.get(PageType.PAGE_INSERT_PROJECT)).setProject(project);
showPage(PageType.PAGE_PROJECT_FILES);
+ wizard.setNextName(I18n.getMessage("jsite.project-files.insert-now"));
wizard.setPreviousName(I18n.getMessage("jsite.wizard.previous"));
} else if ("page.project.files".equals(pageName)) {
ProjectPage projectPage = (ProjectPage) pages.get(PageType.PAGE_PROJECTS);
return;
}
configuration.save();
+ wizard.setNextName(I18n.getMessage("jsite.wizard.next"));
showPage(PageType.PAGE_INSERT_PROJECT);
nodeMenu.setEnabled(false);
} else if ("page.project.insert".equals(pageName)) {
wizard.setPreviousName(I18n.getMessage("jsite.wizard.previous"));
} else if ("page.project.files".equals(pageName)) {
showPage(PageType.PAGE_PROJECTS);
+ wizard.setNextName(I18n.getMessage("jsite.wizard.next"));
wizard.setPreviousName((String) manageNodeAction.getValue(Action.NAME));
} else if ("page.project.insert".equals(pageName)) {
showPage(PageType.PAGE_PROJECT_FILES);
* {@link Node} and delivers resulting {@link Message}s.
*
* @author David Roden <droden@gmail.com>
- * @version $Id: Client.java 413 2006-03-29 12:22:31Z bombe $
+ * @version $Id$
*/
public class Client implements ConnectionListener {
* The node can answer with the following messages: <code>NodeHello</code>.
*
* @author David Roden <droden@gmail.com>
- * @version $Id: ClientHello.java 356 2006-03-24 15:13:38Z bombe $
+ * @version $Id$
*/
public class ClientHello extends Command {
* requests have in common.
*
* @author David Roden <droden@gmail.com>
- * @version $Id: ClientPut.java 356 2006-03-24 15:13:38Z bombe $
+ * @version $Id$
*/
public abstract class ClientPut extends Command {
* command can be used to insert directories that do not exist on disk.
*
* @author David Roden <droden@gmail.com>
- * @version $Id: ClientPutComplexDir.java 356 2006-03-24 15:13:38Z bombe $
+ * @version $Id$
*/
public class ClientPutComplexDir extends ClientPutDir {
* Abstract base class for all put requests that insert a directory.
*
* @author David Roden <droden@gmail.com>
- * @version $Id: ClientPutDir.java 356 2006-03-24 15:13:38Z bombe $
+ * @version $Id$
*/
public class ClientPutDir extends ClientPut {
* something you did not expect.
*
* @author David Roden <droden@gmail.com>
- * @version $Id: Command.java 371 2006-03-25 10:38:13Z bombe $
+ * @version $Id$
*/
public abstract class Command {
* A physical connection to a Freenet node.
*
* @author David Roden <droden@gmail.com>
- * @version $Id: Connection.java 413 2006-03-29 12:22:31Z bombe $
+ * @version $Id$
*/
public class Connection {
nodeSocket.setReceiveBufferSize(65535);
nodeInputStream = nodeSocket.getInputStream();
nodeOutputStream = nodeSocket.getOutputStream();
- // nodeWriter = new TeeWriter(new
- // OutputStreamWriter(nodeOutputStream, Charset.forName("UTF-8")),
- // new PrintWriter(System.out));
nodeWriter = new OutputStreamWriter(nodeOutputStream, Charset.forName("UTF-8"));
nodeReader = new NodeReader(nodeInputStream);
Thread nodeReaderThread = new Thread(nodeReader);
* listeners about the messages.
*
* @author David Roden <droden@gmail.com>
- * @version $Id: Connection.java 413 2006-03-29 12:22:31Z bombe $
+ * @version $Id$
*/
private class NodeReader implements Runnable {
Message message = null;
while (line != null) {
line = nodeReader.readLine();
- // System.err.println("> " + line);
+ System.err.println("> " + line);
if (line == null) {
break;
}
* Interface for clients that want to be notified when a message was received.
*
* @author David Roden <droden@gmail.com>
- * @version $Id: ConnectionListener.java 356 2006-03-24 15:13:38Z bombe $
+ * @version $Id$
*/
public interface ConnectionListener extends EventListener {
* existing FCP connection.
*
* @author David Roden <droden@gmail.com>
- * @version $Id: DirectFileEntry.java 413 2006-03-29 12:22:31Z bombe $
+ * @version $Id$
*/
public class DirectFileEntry extends FileEntry {
* A {@link FileEntry} that reads the content from a file on the disk.
*
* @author David Roden <droden@gmail.com>
- * @version $Id: DiskFileEntry.java 413 2006-03-29 12:22:31Z bombe $
+ * @version $Id$
*/
public class DiskFileEntry extends FileEntry {
* the files of an insert.
*
* @author David Roden <droden@gmail.com>
- * @version $Id: FileEntry.java 413 2006-03-29 12:22:31Z bombe $
+ * @version $Id$
*/
public abstract class FileEntry {
* The node can answer with the following messages: <code>SSKKeypair</code>.
*
* @author David Roden <droden@gmail.com>
- * @version $Id: GenerateSSK.java 413 2006-03-29 12:22:31Z bombe $
+ * @version $Id$
*/
public class GenerateSSK extends Command {
* <code>SSKKeypair</code>, and <code>EndListPersistentRequests</code>.
*
* @author David Roden <droden@gmail.com>
- * @version $Id: Message.java 413 2006-03-29 12:22:31Z bombe $
+ * @version $Id$
* @see de.todesbaum.util.freenet.fcp2.Client
*/
public class Message {
* Contains the hostname and port number of the Freenet node.
*
* @author David Roden <droden@gmail.com>
- * @version $Id: Node.java 356 2006-03-24 15:13:38Z bombe $
+ * @version $Id$
*/
public class Node {
package de.todesbaum.util.freenet.fcp2;
/**
+ * The possible persistence options. This specify whether (and for how long) the
+ * node remembers to execute a request and the results. Possible values are
+ * <code>connection</code>, <code>reboot</code>, and <code>forever</code>.
+ * <code>connection</code> means that a request is aborted as soon as the
+ * connection to the node is severed. <code>reboot</code> means that a request
+ * is remembered as long as the node is running but not after restarts.
+ * <code>forever</code> finally means that a request persists until it is
+ * explicitely deleted.
+ *
* @author David Roden <droden@gmail.com>
- * @version $Id: Persistence.java 373 2006-03-25 10:42:52Z bombe $
+ * @version $Id$
+ * @see de.todesbaum.util.freenet.fcp2.ModifyPersistentRequest
+ * @see de.todesbaum.util.freenet.fcp2.RemovePersistentRequest
*/
public final class Persistence {
+ /**
+ * Denotes that a request should be terminated if the connection to the node
+ * is severed.
+ */
public static final Persistence CONNECTION = new Persistence("connection");
+
+ /** Denotes that a request should be remembered until the node is restarted. */
public static final Persistence REBOOT = new Persistence("reboot");
+
+ /**
+ * Denotes that a request should be remembered until it is explicitely
+ * deleted.
+ */
public static final Persistence FOREVER = new Persistence("forever");
+ /** The name of this persistence option. */
private String name;
+ /**
+ * Private constructor that creates a persistence option with the specified
+ * name.
+ *
+ * @param name
+ * The name of the persistence option.
+ */
private Persistence(String name) {
this.name = name;
}
/**
- * @return Returns the name.
+ * Returns the name of this persistence option.
+ *
+ * @return The name of this persistence option
*/
public String getName() {
return name;
}
+ /**
+ * Returns a textual representation of this persistence option. The result
+ * is identical to calling {@link #getName()}.
+ *
+ * @return The name of this persistence option
+ */
public String toString() {
return name;
}
package de.todesbaum.util.freenet.fcp2;
/**
+ * The possible priority classes. Possible values are, in order of descending
+ * priority: <code>maximum</code> (anything more important than fproxy),
+ * <code>interactive</code> (fproxy), <code>semi-interactive</code> (fproxy
+ * immediate mode large file downloads, not to disk), <code>updatable</code>
+ * (updatable site checks), <code>bulk</code> (large file downloads to disk),
+ * <code>prefetch</code>, <code>minimum</code>.
+ *
* @author David Roden <droden@gmail.com>
- * @version $Id: PriorityClass.java 356 2006-03-24 15:13:38Z bombe $
+ * @version $Id$
*/
public final class PriorityClass {
+ /** Denotes <code>maximum</code> priority class. */
public static final PriorityClass MAXIMUM = new PriorityClass("maximum", 0);
+
+ /** Denotes <code>interactive</code> priority class. */
public static final PriorityClass INTERACTIVE = new PriorityClass("interactive", 1);
+
+ /** Denotes <code>semi-interactive</code> priority class. */
public static final PriorityClass SEMI_INTERACTIVE = new PriorityClass("semiInteractive", 2);
+
+ /** Denotes <code>updatable</code> priority class. */
public static final PriorityClass UPDATABLE = new PriorityClass("updatable", 3);
+
+ /** Denotes <code>bulk</code> priority class. */
public static final PriorityClass BULK = new PriorityClass("bulk", 4);
+
+ /** Denotes <code>prefetch</code> priority class. */
public static final PriorityClass PREFETCH = new PriorityClass("prefetch", 5);
+
+ /** Denotes <code>minimum</code> priority class. */
public static final PriorityClass MINIMUM = new PriorityClass("minimum", 6);
+ /** The name of the priority class. */
private String name;
+
+ /** The value of the priority class. */
private int value;
+ /**
+ * Creates a new priority class with the specified name and value.
+ *
+ * @param name
+ * The name of the priority class
+ * @param value
+ * The value of the priority class
+ */
private PriorityClass(String name, int value) {
this.name = name;
this.value = value;
}
/**
- * @return Returns the name.
+ * Returns the name of this priority class.
+ *
+ * @return The name of this priority class
*/
public String getName() {
return name;
}
/**
- * @return Returns the value.
+ * Returns the value of this priority class.
+ *
+ * @return The value of this priority class
*/
public int getValue() {
return value;
/**
* @author David Roden <droden@gmail.com>
- * @version $Id: Verbosity.java 356 2006-03-24 15:13:38Z bombe $
+ * @version $Id$
*/
public final class Verbosity {
/**
* @author <a href="mailto:droden@gmail.com">David Roden</a>
- * @version $Id: IconLoader.java 130 2006-02-18 18:27:11Z bombe $
+ * @version $Id$
*/
public class IconLoader {
/**
* @author David Roden <droden@gmail.com>
- * @version $Id: LineInputStream.java 429 2006-03-29 18:04:48Z bombe $
+ * @version $Id$
*/
public class LineInputStream extends FilterInputStream {
/**
* @author David Roden <droden@gmail.com>
- * @version $Id: ReplacingOutputStream.java 431 2006-03-29 18:06:18Z bombe $
+ * @version $Id$
*/
public class ReplacingOutputStream extends FilterOutputStream {
* Copies input from an {@link InputStream} to an {@link OutputStream}.
*
* @author <a href="mailto:droden@gmail.com">David Roden</a>
- * @version $Id: StreamCopier.java 428 2006-03-29 18:03:36Z bombe $
+ * @version $Id$
*/
public class StreamCopier {
/**
* @author David Roden <droden@gmail.com>
- * @version $Id: SortedListModel.java 338 2006-03-20 15:40:48Z bombe $
+ * @version $Id$
*/
public class SortedListModel extends AbstractListModel implements List {
/**
* @author David Roden <droden@gmail.com>
- * @version $Id: TLabel.java 280 2006-03-17 20:24:27Z bombe $
+ * @version $Id$
*/
public class TLabel extends JLabel {
/**
* @author David Roden <droden@gmail.com>
- * @version $Id: TWizard.java 426 2006-03-29 18:02:50Z bombe $
+ * @version $Id$
*/
public class TWizard extends JFrame implements WindowListener {
/**
* @author David Roden <droden@gmail.com>
- * @version $Id: TWizardPage.java 427 2006-03-29 18:03:06Z bombe $
+ * @version $Id$
*/
public class TWizardPage extends JPanel {
/**
* @author David Roden <droden@gmail.com>
- * @version $Id: WizardListener.java 280 2006-03-17 20:24:27Z bombe $
+ * @version $Id$
*/
public interface WizardListener extends EventListener {