implement node addition and removal events
[jSite2.git] / src / net / pterodactylus / util / fcp / AllData.java
index c2ead16..37ffa08 100644 (file)
@@ -30,7 +30,7 @@ public class AllData extends BaseMessage {
         * @param payloadInputStream
         *            The payload
         */
-       public AllData(FcpMessage receivedMessage, InputStream payloadInputStream) {
+       AllData(FcpMessage receivedMessage, InputStream payloadInputStream) {
                super(receivedMessage);
                this.payloadInputStream = payloadInputStream;
        }
@@ -51,11 +51,7 @@ public class AllData extends BaseMessage {
         *         not be parsed
         */
        public long getDataLength() {
-               try {
-                       return Long.valueOf(getField("DataLength"));
-               } catch (NumberFormatException nfe1) {
-                       return -1;
-               }
+               return FcpUtils.safeParseLong(getField("DataLength"));
        }
 
        /**
@@ -65,11 +61,7 @@ public class AllData extends BaseMessage {
         *         1970 UTC), or <code>-1</code> if the time could not be parsed
         */
        public long getStartupTime() {
-               try {
-                       return Long.valueOf(getField("StartupTime"));
-               } catch (NumberFormatException nfe1) {
-                       return -1;
-               }
+               return FcpUtils.safeParseLong(getField("StartupTime"));
        }
 
        /**
@@ -79,11 +71,7 @@ public class AllData extends BaseMessage {
         *         1970 UTC), or <code>-1</code> if the time could not be parsed
         */
        public long getCompletionTime() {
-               try {
-                       return Long.valueOf(getField("CompletionTime"));
-               } catch (NumberFormatException nfe1) {
-                       return -1;
-               }
+               return FcpUtils.safeParseLong(getField("CompletionTime"));
        }
 
        /**