Formatting fixes.
[jFCPlib.git] / src / net / pterodactylus / fcp / GetFailed.java
index 161da9e..e624644 100644 (file)
@@ -45,9 +45,9 @@ public class GetFailed extends BaseMessage {
 
        /**
         * Returns the code of the error.
-        * 
-        * @return The code of the error, or <code>-1</code> if the error code
-        *         could not be parsed
+        *
+        * @return The code of the error, or <code>-1</code> if the error code could
+        *         not be parsed
         */
        public int getCode() {
                return FcpUtils.safeParseInt(getField("Code"));
@@ -101,9 +101,9 @@ public class GetFailed extends BaseMessage {
 
        /**
         * Returns the expected data length, if already knows.
-        * 
-        * @return The expected data length, or <code>-1</code> if the length
-        *         could not be parsed
+        *
+        * @return The expected data length, or <code>-1</code> if the length could
+        *         not be parsed
         */
        public long getExpectedDataLength() {
                return FcpUtils.safeParseLong(getField("ExpectedDataLength"));
@@ -143,6 +143,17 @@ public class GetFailed extends BaseMessage {
        }
 
        /**
+        * Returns whether the request failed fatally. If a request fails fatally it
+        * can never complete, even with inifinite retries.
+        *
+        * @return <code>true</code> if the request failed fatally,
+        *         <code>false</code> otherwise
+        */
+       public boolean isFatal() {
+               return Boolean.valueOf(getField("Fatal"));
+       }
+
+       /**
         * Returns a list of complex error codes with the message. Use
         * {@link #getComplexErrorDescription(int)} and
         * {@link #getComplexErrorCount(int)} to get details.
@@ -152,7 +163,7 @@ public class GetFailed extends BaseMessage {
        public int[] getComplexErrorCodes() {
                Map<String, String> allFields = getFields();
                List<Integer> errorCodeList = new ArrayList<Integer>();
-               for (Entry<String, String> field: allFields.entrySet()) {
+               for (Entry<String, String> field : allFields.entrySet()) {
                        String fieldKey = field.getKey();
                        if (fieldKey.startsWith("Errors.")) {
                                int nextDot = fieldKey.indexOf('.', 7);
@@ -166,7 +177,7 @@ public class GetFailed extends BaseMessage {
                }
                int[] errorCodes = new int[errorCodeList.size()];
                int errorIndex = 0;
-               for (int errorCode: errorCodeList) {
+               for (int errorCode : errorCodeList) {
                        errorCodes[errorIndex++] = errorCode;
                }
                return errorCodes;