More whitespace fixes.
[jFCPlib.git] / src / net / pterodactylus / fcp / PersistentPut.java
index 0ec8a7e..383ea93 100644 (file)
@@ -1,6 +1,5 @@
 /*
- * jSite2 - PersistentPut.java -
- * Copyright © 2008 David Roden
+ * jFCPlib - PersistentPut.java - Copyright © 2008 David Roden
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -22,15 +21,14 @@ package net.pterodactylus.fcp;
 /**
  * A “PersistentPut” message notifies a client about a persistent
  * {@link ClientPut} request.
- * 
- * @author <a href="mailto:dr@ina-germany.de">David Roden</a>
- * @version $Id$
+ *
+ * @author David ‘Bombe’ Roden &lt;bombe@freenetproject.org&gt;
  */
 public class PersistentPut extends BaseMessage {
 
        /**
         * Creates a new “PersistentPut” message that wraps the received message.
-        * 
+        *
         * @param receivedMessage
         *            The received message
         */
@@ -40,7 +38,7 @@ public class PersistentPut extends BaseMessage {
 
        /**
         * Returns the client token of the request.
-        * 
+        *
         * @return The client token of the request
         */
        public String getClientToken() {
@@ -49,9 +47,9 @@ public class PersistentPut extends BaseMessage {
 
        /**
         * Returns the data length of the request.
-        * 
-        * @return The data length of the request, or <code>-1</code> if the
-        *         length could not be parsed
+        *
+        * @return The data length of the request, or <code>-1</code> if the length
+        *         could not be parsed
         */
        public long getDataLength() {
                return FcpUtils.safeParseLong(getField("DataLength"));
@@ -59,7 +57,7 @@ public class PersistentPut extends BaseMessage {
 
        /**
         * Returns whether the request is on the global queue.
-        * 
+        *
         * @return <code>true</code> if the request is on the global queue,
         *         <code>false</code> otherwise
         */
@@ -69,7 +67,7 @@ public class PersistentPut extends BaseMessage {
 
        /**
         * Returns the identifier of the request.
-        * 
+        *
         * @return The identifier of the request
         */
        public String getIdentifier() {
@@ -79,10 +77,10 @@ public class PersistentPut extends BaseMessage {
        /**
         * Returns the maximum number of retries for failed blocks. When
         * <code>-1</code> is returned each block is tried forever.
-        * 
+        *
         * @return The maximum number of retries for failed blocks, or
-        *         <code>-1</code> for unlimited retries, or <code>-2</code> if
-        *         the number of retries could not be parsed
+        *         <code>-1</code> for unlimited retries, or <code>-2</code> if the
+        *         number of retries could not be parsed
         */
        public int getMaxRetries() {
                return FcpUtils.safeParseInt(getField("MaxRetries"));
@@ -90,7 +88,7 @@ public class PersistentPut extends BaseMessage {
 
        /**
         * Returns the content type of the data.
-        * 
+        *
         * @return The content type
         */
        public String getMetadataContentType() {
@@ -99,7 +97,7 @@ public class PersistentPut extends BaseMessage {
 
        /**
         * Returns the persistence of the request.
-        * 
+        *
         * @return The persistence of the request
         */
        public Persistence getPersistence() {
@@ -108,23 +106,19 @@ public class PersistentPut extends BaseMessage {
 
        /**
         * Returns the priority of the request.
-        * 
+        *
         * @return The priority of the request, or {@link Priority#unknown} if the
         *         priority could not be parsed
         */
        public Priority getPriority() {
-               try {
-                       return Priority.values()[Integer.valueOf(getField("PriorityClass"))];
-               } catch (NumberFormatException nfe1) {
-                       return Priority.unknown;
-               }
+               return Priority.values()[FcpUtils.safeParseInt(getField("PriorityClass"), Priority.unknown.ordinal())];
        }
 
        /**
         * Returns whether this request has started.
-        * 
-        * @return <code>true</code> if the request has started,
-        *         <code>false</code> otherwise
+        *
+        * @return <code>true</code> if the request has started, <code>false</code>
+        *         otherwise
         */
        public boolean isStarted() {
                return Boolean.valueOf(getField("Started"));
@@ -132,7 +126,7 @@ public class PersistentPut extends BaseMessage {
 
        /**
         * Returns the target filename of the request.
-        * 
+        *
         * @return The target filename of the request
         */
        public String getTargetFilename() {
@@ -141,7 +135,7 @@ public class PersistentPut extends BaseMessage {
 
        /**
         * Returns the upload source of the request.
-        * 
+        *
         * @return The upload source of the request
         */
        public UploadFrom getUploadFrom() {
@@ -150,7 +144,7 @@ public class PersistentPut extends BaseMessage {
 
        /**
         * Returns the target URI of the request.
-        * 
+        *
         * @return The target URI of the request
         */
        public String getURI() {
@@ -159,7 +153,7 @@ public class PersistentPut extends BaseMessage {
 
        /**
         * Returns the verbosity of the request.
-        * 
+        *
         * @return The verbosity of the request
         */
        public Verbosity getVerbosity() {