From 19b64d7251237d7fae94b152d8a83b346ff77c33 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 22 Jul 2009 18:22:21 +0200 Subject: [PATCH] Formatting fixes. --- src/net/pterodactylus/fcp/ClientPut.java | 20 ++++++++++---------- src/net/pterodactylus/fcp/ClientPutComplexDir.java | 6 +++--- src/net/pterodactylus/fcp/ClientPutDiskDir.java | 4 ++-- src/net/pterodactylus/fcp/FCPPluginMessage.java | 3 ++- src/net/pterodactylus/fcp/FcpMessage.java | 18 +++++++++--------- src/net/pterodactylus/fcp/FcpUtils.java | 16 ++++++++-------- src/net/pterodactylus/fcp/FileEntry.java | 16 ++++++++-------- src/net/pterodactylus/fcp/GetNode.java | 4 ++-- src/net/pterodactylus/fcp/ListPeer.java | 6 +++--- src/net/pterodactylus/fcp/ListPeers.java | 8 ++++---- src/net/pterodactylus/fcp/NodeData.java | 4 ++-- src/net/pterodactylus/fcp/PersistentPut.java | 12 ++++++------ src/net/pterodactylus/fcp/PersistentPutDir.java | 6 ++---- .../pterodactylus/fcp/PersistentRequestRemoved.java | 4 ++-- src/net/pterodactylus/fcp/ProtocolError.java | 8 ++++---- src/net/pterodactylus/fcp/PutFailed.java | 8 ++++---- src/net/pterodactylus/fcp/TestDDARequest.java | 6 ++---- src/net/pterodactylus/fcp/TestDDAResponse.java | 4 ++-- src/net/pterodactylus/fcp/URIGenerated.java | 4 ++-- src/net/pterodactylus/fcp/highlevel/Request.java | 1 - 20 files changed, 77 insertions(+), 81 deletions(-) diff --git a/src/net/pterodactylus/fcp/ClientPut.java b/src/net/pterodactylus/fcp/ClientPut.java index 5185deb..b9eea25 100644 --- a/src/net/pterodactylus/fcp/ClientPut.java +++ b/src/net/pterodactylus/fcp/ClientPut.java @@ -22,7 +22,8 @@ package net.pterodactylus.fcp; /** * A “ClientPut” requests inserts a single file into freenet, either uploading * it directly with this messge ({@link UploadFrom#direct}), uploading it from - * disk ({@link UploadFrom#disk}) or by creating a redirect to another URI ({@link UploadFrom#redirect}). + * disk ({@link UploadFrom#disk}) or by creating a redirect to another URI ( + * {@link UploadFrom#redirect}). * * @author David ‘Bombe’ Roden <bombe@freenetproject.org> */ @@ -47,17 +48,16 @@ public class ClientPut extends FcpMessage { /** * Creates a new “ClientPut” message that inserts a file to the given URI. - * Depending on uploadFrom the file data has to be supplied - * in different ways: If uploadFrom is - * {@link UploadFrom#direct}, use - * {@link #setPayloadInputStream(java.io.InputStream)} to supply the input - * data. If uploadFrom is {@link UploadFrom#disk}, use + * Depending on uploadFrom the file data has to be supplied in + * different ways: If uploadFrom is {@link UploadFrom#direct}, + * use {@link #setPayloadInputStream(java.io.InputStream)} to supply the + * input data. If uploadFrom is {@link UploadFrom#disk}, use * {@link #setFilename(String)} to supply the file to upload. You have to * test your direct-disk access (see {@link TestDDARequest}, * {@link TestDDAReply}, {@link TestDDAResponse}, {@link TestDDAComplete}) * before using this option! If uploadFrom is - * {@link UploadFrom#redirect}, use {@link #setTargetURI(String)} to set - * the target URI of the redirect. + * {@link UploadFrom#redirect}, use {@link #setTargetURI(String)} to set the + * target URI of the redirect. * * @param uri * The URI to insert to @@ -145,8 +145,8 @@ public class ClientPut extends FcpMessage { * already been compressed. * * @param dontCompress - * true to skip compression of the data in the - * node, false to allow compression + * true to skip compression of the data in the node, + * false to allow compression */ public void setDontCompress(boolean dontCompress) { setField("DontCompress", String.valueOf(dontCompress)); diff --git a/src/net/pterodactylus/fcp/ClientPutComplexDir.java b/src/net/pterodactylus/fcp/ClientPutComplexDir.java index 9560203..ada473c 100644 --- a/src/net/pterodactylus/fcp/ClientPutComplexDir.java +++ b/src/net/pterodactylus/fcp/ClientPutComplexDir.java @@ -186,7 +186,7 @@ public class ClientPutComplexDir extends FcpMessage { */ public void addFileEntry(FileEntry fileEntry) { Map fields = fileEntry.getFields(); - for (Entry fieldEntry: fields.entrySet()) { + for (Entry fieldEntry : fields.entrySet()) { setField("Files." + fileIndex + "." + fieldEntry.getKey(), fieldEntry.getValue()); } fileIndex++; @@ -199,8 +199,8 @@ public class ClientPutComplexDir extends FcpMessage { * {@inheritDoc} *

* Do not call this method to add input streams! The input streams, if any, - * will be taken directly from the {@link FileEntry}s and the stream you - * set here will be overridden! + * will be taken directly from the {@link FileEntry}s and the stream you set + * here will be overridden! */ @Override public void setPayloadInputStream(InputStream payloadInputStream) { diff --git a/src/net/pterodactylus/fcp/ClientPutDiskDir.java b/src/net/pterodactylus/fcp/ClientPutDiskDir.java index 540e088..3bb8274 100644 --- a/src/net/pterodactylus/fcp/ClientPutDiskDir.java +++ b/src/net/pterodactylus/fcp/ClientPutDiskDir.java @@ -106,8 +106,8 @@ public class ClientPutDiskDir extends FcpMessage { * already been compressed. * * @param dontCompress - * true to skip compression of the data in the - * node, false to allow compression + * true to skip compression of the data in the node, + * false to allow compression */ public void setDontCompress(boolean dontCompress) { setField("DontCompress", String.valueOf(dontCompress)); diff --git a/src/net/pterodactylus/fcp/FCPPluginMessage.java b/src/net/pterodactylus/fcp/FCPPluginMessage.java index b551b3f..3593fc0 100644 --- a/src/net/pterodactylus/fcp/FCPPluginMessage.java +++ b/src/net/pterodactylus/fcp/FCPPluginMessage.java @@ -64,7 +64,8 @@ public class FCPPluginMessage extends FcpMessage { /** * Sets the length of data of the optional payload. If you call this method - * you also have to call {@link #setPayloadInputStream(java.io.InputStream)}! + * you also have to call {@link #setPayloadInputStream(java.io.InputStream)} + * ! * * @param dataLength * The length of data in the payload input stream diff --git a/src/net/pterodactylus/fcp/FcpMessage.java b/src/net/pterodactylus/fcp/FcpMessage.java index 96e5f65..a2ac894 100644 --- a/src/net/pterodactylus/fcp/FcpMessage.java +++ b/src/net/pterodactylus/fcp/FcpMessage.java @@ -88,8 +88,8 @@ public class FcpMessage implements Iterable { * * @param field * The name of the field to check for - * @return true if the message has a field with the given - * name, false otherwise + * @return true if the message has a field with the given name, + * false otherwise */ public boolean hasField(String field) { return fields.containsKey(field); @@ -116,8 +116,8 @@ public class FcpMessage implements Iterable { * * @param field * The name of the field - * @return The value of the field, or null if there is no - * such field + * @return The value of the field, or null if there is no such + * field */ public String getField(String field) { return fields.get(field); @@ -151,10 +151,10 @@ public class FcpMessage implements Iterable { /** * Writes this message to the given output stream. If the message has a - * payload (i.e. {@link #payloadInputStream} is not null) - * the payload is written to the given output stream after the message as - * well. That means that this method can only be called once because on the - * second invocation the payload input stream could not be read (again). + * payload (i.e. {@link #payloadInputStream} is not null) the + * payload is written to the given output stream after the message as well. + * That means that this method can only be called once because on the second + * invocation the payload input stream could not be read (again). * * @param outputStream * The output stream to write the message to @@ -163,7 +163,7 @@ public class FcpMessage implements Iterable { */ public void write(OutputStream outputStream) throws IOException { writeLine(outputStream, name); - for (Entry fieldEntry: fields.entrySet()) { + for (Entry fieldEntry : fields.entrySet()) { writeLine(outputStream, fieldEntry.getKey() + "=" + fieldEntry.getValue()); } writeLine(outputStream, "EndMessage"); diff --git a/src/net/pterodactylus/fcp/FcpUtils.java b/src/net/pterodactylus/fcp/FcpUtils.java index a785924..02e8c20 100644 --- a/src/net/pterodactylus/fcp/FcpUtils.java +++ b/src/net/pterodactylus/fcp/FcpUtils.java @@ -111,8 +111,8 @@ public class FcpUtils { } /** - * Tries to parse the given string into an int, returning -1 - * if the string can not be parsed. + * Tries to parse the given string into an int, returning -1 if + * the string can not be parsed. * * @param value * The string to parse @@ -204,8 +204,8 @@ public class FcpUtils { /** * Copies as many bytes as possible (i.e. until {@link InputStream#read()} - * returns -1) from the source input stream to the - * destination output stream. + * returns -1) from the source input stream to the destination + * output stream. * * @param source * The input stream to read from @@ -220,8 +220,8 @@ public class FcpUtils { /** * Copies length bytes from the source input stream to the - * destination output stream. If length is -1 - * as much bytes as possible will be copied (i.e. until + * destination output stream. If length is -1 as + * much bytes as possible will be copied (i.e. until * {@link InputStream#read()} returns -1 to signal the end of * the stream). * @@ -240,8 +240,8 @@ public class FcpUtils { /** * Copies length bytes from the source input stream to the - * destination output stream. If length is -1 - * as much bytes as possible will be copied (i.e. until + * destination output stream. If length is -1 as + * much bytes as possible will be copied (i.e. until * {@link InputStream#read()} returns -1 to signal the end of * the stream). * diff --git a/src/net/pterodactylus/fcp/FileEntry.java b/src/net/pterodactylus/fcp/FileEntry.java index baa0b6d..c047635 100644 --- a/src/net/pterodactylus/fcp/FileEntry.java +++ b/src/net/pterodactylus/fcp/FileEntry.java @@ -57,8 +57,8 @@ public abstract class FileEntry { * @param name * The name of the file * @param contentType - * The content type of the file, or null to let - * the node auto-detect it + * The content type of the file, or null to let the + * node auto-detect it * @param length * The length of the file * @param dataInputStream @@ -77,8 +77,8 @@ public abstract class FileEntry { * @param filename * The name of the file on disk * @param contentType - * The content type of the file, or null to let - * the node auto-detect it + * The content type of the file, or null to let the + * node auto-detect it * @param length * The length of the file, or -1 to not specify a * size @@ -145,8 +145,8 @@ public abstract class FileEntry { * @param name * The name of the file * @param contentType - * The content type of the file, or null to - * let the node auto-detect it + * The content type of the file, or null to let + * the node auto-detect it * @param length * The length of the file * @param inputStream @@ -223,8 +223,8 @@ public abstract class FileEntry { * @param filename * The name of the on-disk file * @param contentType - * The content type of the file, or null to - * let the node auto-detect it + * The content type of the file, or null to let + * the node auto-detect it * @param length * The length of the file */ diff --git a/src/net/pterodactylus/fcp/GetNode.java b/src/net/pterodactylus/fcp/GetNode.java index eefa016..4ca7cb0 100644 --- a/src/net/pterodactylus/fcp/GetNode.java +++ b/src/net/pterodactylus/fcp/GetNode.java @@ -37,8 +37,8 @@ public class GetNode extends FcpMessage { /** * Creates a “GetNode” command that returns the request noderef of the node, * including private and volatile data, if requested. If any of the Boolean - * parameters are null the parameter is ignored and the - * node’s default value is used. + * parameters are null the parameter is ignored and the node’s + * default value is used. * * @param giveOpennetRef * true to request the opennet noderef, diff --git a/src/net/pterodactylus/fcp/ListPeer.java b/src/net/pterodactylus/fcp/ListPeer.java index c338dc9..d3d601d 100644 --- a/src/net/pterodactylus/fcp/ListPeer.java +++ b/src/net/pterodactylus/fcp/ListPeer.java @@ -28,9 +28,9 @@ public class ListPeer extends FcpMessage { /** * Creates a new “ListPeer” request that returns information about the node - * specified by nodeIdentifier. nodeIdentifier - * can be of several formats: The node’s name, its identity, or its IP - * address and port (connection with a ‘:’). + * specified by nodeIdentifier. nodeIdentifier can + * be of several formats: The node’s name, its identity, or its IP address + * and port (connection with a ‘:’). * * @param nodeIdentifier * The identifier of the node to get details about diff --git a/src/net/pterodactylus/fcp/ListPeers.java b/src/net/pterodactylus/fcp/ListPeers.java index 00b7162..85951c0 100644 --- a/src/net/pterodactylus/fcp/ListPeers.java +++ b/src/net/pterodactylus/fcp/ListPeers.java @@ -43,11 +43,11 @@ public class ListPeers extends FcpMessage { * @param identifier * The identifier of the request * @param withMetadata - * If true metadata of the peers is included in - * the reply + * If true metadata of the peers is included in the + * reply * @param withVolatile - * if true volatile data of the peers is included - * in the reply + * if true volatile data of the peers is included in + * the reply */ public ListPeers(String identifier, boolean withMetadata, boolean withVolatile) { super("ListPeers"); diff --git a/src/net/pterodactylus/fcp/NodeData.java b/src/net/pterodactylus/fcp/NodeData.java index 6e2d25a..322cdd5 100644 --- a/src/net/pterodactylus/fcp/NodeData.java +++ b/src/net/pterodactylus/fcp/NodeData.java @@ -167,8 +167,8 @@ public class NodeData extends BaseMessage { * * @param field * The name of the field - * @return The value of the field, or null if there is no - * such field + * @return The value of the field, or null if there is no such + * field */ public String getVolatile(String field) { return getField("volatile." + field); diff --git a/src/net/pterodactylus/fcp/PersistentPut.java b/src/net/pterodactylus/fcp/PersistentPut.java index 30b89b5..dc9ec4c 100644 --- a/src/net/pterodactylus/fcp/PersistentPut.java +++ b/src/net/pterodactylus/fcp/PersistentPut.java @@ -49,8 +49,8 @@ public class PersistentPut extends BaseMessage { /** * Returns the data length of the request. * - * @return The data length of the request, or -1 if the - * length could not be parsed + * @return The data length of the request, or -1 if the length + * could not be parsed */ public long getDataLength() { return FcpUtils.safeParseLong(getField("DataLength")); @@ -80,8 +80,8 @@ public class PersistentPut extends BaseMessage { * -1 is returned each block is tried forever. * * @return The maximum number of retries for failed blocks, or - * -1 for unlimited retries, or -2 if - * the number of retries could not be parsed + * -1 for unlimited retries, or -2 if the + * number of retries could not be parsed */ public int getMaxRetries() { return FcpUtils.safeParseInt(getField("MaxRetries")); @@ -118,8 +118,8 @@ public class PersistentPut extends BaseMessage { /** * Returns whether this request has started. * - * @return true if the request has started, - * false otherwise + * @return true if the request has started, false + * otherwise */ public boolean isStarted() { return Boolean.valueOf(getField("Started")); diff --git a/src/net/pterodactylus/fcp/PersistentPutDir.java b/src/net/pterodactylus/fcp/PersistentPutDir.java index bf9f1aa..3ea8af9 100644 --- a/src/net/pterodactylus/fcp/PersistentPutDir.java +++ b/src/net/pterodactylus/fcp/PersistentPutDir.java @@ -101,10 +101,8 @@ public class PersistentPutDir extends BaseMessage { */ public int getFileCount() { int fileCount = -1; - while (getField("Files." + ++fileCount + ".UploadFrom") != null) { /* - * do - * nothing. - */ + while (getField("Files." + ++fileCount + ".UploadFrom") != null) { + /* do nothing. */ } return fileCount; } diff --git a/src/net/pterodactylus/fcp/PersistentRequestRemoved.java b/src/net/pterodactylus/fcp/PersistentRequestRemoved.java index 27322ba..ac98a55 100644 --- a/src/net/pterodactylus/fcp/PersistentRequestRemoved.java +++ b/src/net/pterodactylus/fcp/PersistentRequestRemoved.java @@ -51,8 +51,8 @@ public class PersistentRequestRemoved extends BaseMessage { * Returns whether the request was removed from the global queue. * * @return true if the request was removed from the global - * queue, false if it was removed from the - * client-local queue + * queue, false if it was removed from the client-local + * queue */ public boolean isGlobal() { return Boolean.valueOf(getField("Global")); diff --git a/src/net/pterodactylus/fcp/ProtocolError.java b/src/net/pterodactylus/fcp/ProtocolError.java index d727e33..05d169d 100644 --- a/src/net/pterodactylus/fcp/ProtocolError.java +++ b/src/net/pterodactylus/fcp/ProtocolError.java @@ -49,8 +49,8 @@ public class ProtocolError extends BaseMessage { /** * Returns the error code. * - * @return The error code, or -1 if the error code could not - * be parsed + * @return The error code, or -1 if the error code could not be + * parsed */ public int getCode() { return FcpUtils.safeParseInt(getField("Code")); @@ -68,8 +68,8 @@ public class ProtocolError extends BaseMessage { /** * Returns some extra description of the error. * - * @return Extra description of the error, or null if there - * is none + * @return Extra description of the error, or null if there is + * none */ public String getExtraDescription() { return getField("ExtraDescription"); diff --git a/src/net/pterodactylus/fcp/PutFailed.java b/src/net/pterodactylus/fcp/PutFailed.java index 8a765e9..b4e1957 100644 --- a/src/net/pterodactylus/fcp/PutFailed.java +++ b/src/net/pterodactylus/fcp/PutFailed.java @@ -46,8 +46,8 @@ public class PutFailed extends BaseMessage { /** * Returns the code of the error. * - * @return The code of the error, or -1 if the error code - * could not be parsed + * @return The code of the error, or -1 if the error code could + * not be parsed */ public int getCode() { return FcpUtils.safeParseInt(getField("Code")); @@ -129,7 +129,7 @@ public class PutFailed extends BaseMessage { public int[] getComplexErrorCodes() { Map allFields = getFields(); List errorCodeList = new ArrayList(); - for (Entry field: allFields.entrySet()) { + for (Entry field : allFields.entrySet()) { String fieldKey = field.getKey(); if (fieldKey.startsWith("Errors.")) { int nextDot = fieldKey.indexOf('.', 7); @@ -143,7 +143,7 @@ public class PutFailed extends BaseMessage { } int[] errorCodes = new int[errorCodeList.size()]; int errorIndex = 0; - for (int errorCode: errorCodeList) { + for (int errorCode : errorCodeList) { errorCodes[errorIndex++] = errorCode; } return errorCodes; diff --git a/src/net/pterodactylus/fcp/TestDDARequest.java b/src/net/pterodactylus/fcp/TestDDARequest.java index 328c65e..53b47ee 100644 --- a/src/net/pterodactylus/fcp/TestDDARequest.java +++ b/src/net/pterodactylus/fcp/TestDDARequest.java @@ -32,11 +32,9 @@ public class TestDDARequest extends FcpMessage { * @param directory * The directory you want to access files in * @param wantReadDirectory - * true if you want to read files from the - * directory + * true if you want to read files from the directory * @param wantWriteDirectory - * true if you want to write files to the - * directory + * true if you want to write files to the directory */ public TestDDARequest(String directory, boolean wantReadDirectory, boolean wantWriteDirectory) { super("TestDDARequest"); diff --git a/src/net/pterodactylus/fcp/TestDDAResponse.java b/src/net/pterodactylus/fcp/TestDDAResponse.java index 9cbbeeb..c570e21 100644 --- a/src/net/pterodactylus/fcp/TestDDAResponse.java +++ b/src/net/pterodactylus/fcp/TestDDAResponse.java @@ -51,8 +51,8 @@ public class TestDDAResponse extends FcpMessage { * @param directory * The directory from the {@link TestDDARequest} command * @param readContent - * The read content, or null if you did not - * request read access + * The read content, or null if you did not request + * read access */ public TestDDAResponse(String directory, String readContent) { super("TestDDAResponse"); diff --git a/src/net/pterodactylus/fcp/URIGenerated.java b/src/net/pterodactylus/fcp/URIGenerated.java index 7ce9655..6c9983c 100644 --- a/src/net/pterodactylus/fcp/URIGenerated.java +++ b/src/net/pterodactylus/fcp/URIGenerated.java @@ -20,8 +20,8 @@ package net.pterodactylus.fcp; /** * The “URIGenerated” message signals the client that an URI was generated for a - * {@link ClientPut} (or {@link ClientPutDiskDir} or {@link ClientPutComplexDir}) - * request. + * {@link ClientPut} (or {@link ClientPutDiskDir} or {@link ClientPutComplexDir} + * ) request. * * @author David ‘Bombe’ Roden <bombe@freenetproject.org> */ diff --git a/src/net/pterodactylus/fcp/highlevel/Request.java b/src/net/pterodactylus/fcp/highlevel/Request.java index 98c36ce..4e24b02 100644 --- a/src/net/pterodactylus/fcp/highlevel/Request.java +++ b/src/net/pterodactylus/fcp/highlevel/Request.java @@ -236,7 +236,6 @@ public abstract class Request { * @param fatal * true if this request failed fatally, * false otherwise - * */ void setFatal(boolean fatal) { this.fatal = fatal; -- 2.7.4