X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Ffcp%2FPersistentPut.java;h=383ea9326e2d7d27b5203061f2ead28ee91f3004;hb=a655177a4605236e866ac7e0ce32f7cb5289cbc4;hp=0ec8a7eb2514904ebeef23d9970c55a6fb836ce2;hpb=f553531be78d6d6d95dc152728f2b8d40242b57d;p=jFCPlib.git
diff --git a/src/net/pterodactylus/fcp/PersistentPut.java b/src/net/pterodactylus/fcp/PersistentPut.java
index 0ec8a7e..383ea93 100644
--- a/src/net/pterodactylus/fcp/PersistentPut.java
+++ b/src/net/pterodactylus/fcp/PersistentPut.java
@@ -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 David Roden
- * @version $Id$
+ *
+ * @author David âBombeâ Roden <bombe@freenetproject.org>
*/
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 -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"));
@@ -59,7 +57,7 @@ public class PersistentPut extends BaseMessage {
/**
* Returns whether the request is on the global queue.
- *
+ *
* @return true
if the request is on the global queue,
* false
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
* -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"));
@@ -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 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"));
@@ -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() {