You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@abdera.apache.org by jm...@apache.org on 2007/07/12 23:39:45 UTC
svn commit: r555780 -
/incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractResponse.java
Author: jmsnell
Date: Thu Jul 12 14:39:44 2007
New Revision: 555780
URL: http://svn.apache.org/viewvc?view=rev&rev=555780
Log:
Certain proxy servers return really wierd values for things like Age. For instance, it appears that the WAS Edge Caching Proxy will return "Age: -(" on occasion, which
is really not all that cool
Modified:
incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractResponse.java
Modified: incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractResponse.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractResponse.java?view=diff&rev=555780&r1=555779&r2=555780
==============================================================================
--- incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractResponse.java (original)
+++ incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractResponse.java Thu Jul 12 14:39:44 2007
@@ -38,7 +38,11 @@
public long getAge() {
String value = getHeader("Age");
- return (value != null) ? Long.parseLong(value) : -1;
+ try {
+ return (value != null) ? Long.parseLong(value) : -1;
+ } catch (NumberFormatException e) {
+ return -1;
+ }
}
public String getAllow() {
@@ -55,7 +59,11 @@
public long getContentLength() {
String value = getHeader("Content-Length");
- return (value != null) ? Long.parseLong(value) : -1;
+ try {
+ return (value != null) ? Long.parseLong(value) : -1;
+ } catch (NumberFormatException e) {
+ return -1;
+ }
}
public IRI getContentLocation() {