You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2005/02/15 22:00:09 UTC
svn commit: r153959 - in
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui:
core/URLCodec.java util/netui.properties
Author: ekoneil
Date: Tue Feb 15 12:59:47 2005
New Revision: 153959
URL: http://svn.apache.org/viewcvs?view=rev&rev=153959
Log:
Fixup the URLCodec to handle nested exceptions and to internationalize the exception message.
BB: self
DRT: NetUI drt
Modified:
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/URLCodec.java
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties
Modified: incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/URLCodec.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/URLCodec.java?view=diff&r1=153958&r2=153959
==============================================================================
--- incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/URLCodec.java (original)
+++ incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/URLCodec.java Tue Feb 15 12:59:47 2005
@@ -15,18 +15,20 @@
*
* $Header:$
*/
-
package org.apache.beehive.netui.core;
+import java.io.UnsupportedEncodingException;
+
import org.apache.commons.codec.EncoderException;
import org.apache.commons.codec.DecoderException;
-import java.io.UnsupportedEncodingException;
+import org.apache.beehive.netui.util.Bundle;
/**
* Class that provides static methods for URL encoding/decoding
*/
public final class URLCodec {
+
private final static org.apache.commons.codec.net.URLCodec s_codec =
new org.apache.commons.codec.net.URLCodec();
@@ -50,7 +52,7 @@
try {
return s_codec.encode(decoded);
} catch (EncoderException e) {
- throw new IllegalStateException(e.getMessage());
+ throw new IllegalStateException(Bundle.getErrorString("URLCodec_encodeException", new String[] {e.getMessage()}), e);
}
}
@@ -65,8 +67,8 @@
try {
return s_codec.decode(encoded, charset);
} catch (DecoderException e) {
- throw new IllegalStateException(e.getMessage());
- }
+ throw new IllegalStateException(Bundle.getErrorString("URLCodec_decodeException", new String[] {e.getMessage()}), e);
+ }
}
@@ -79,7 +81,7 @@
try {
return s_codec.decode(encoded);
} catch (DecoderException e) {
- throw new IllegalStateException(e.getMessage());
+ throw new IllegalStateException(Bundle.getErrorString("URLCodec_decodeException", new String[] {e.getMessage()}), e);
}
}
}
Modified: incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties?view=diff&r1=153958&r2=153959
==============================================================================
--- incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties (original)
+++ incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties Tue Feb 15 12:59:47 2005
@@ -651,4 +651,6 @@
TypeUtils_javaUtilDateConvertError=Caugnt an error converting a String to a DateFormat.SHORT formatted Date: {0}
TypeUtils_javaSqlDateConvertError=Caught an error converting a String to a java.sql.Date: {0}
TypeUtils_javaSqlTimestampConvertError=Caught an error converting a String to a java.sql.Timestamp: {0}
-TypeUtils_javaSqlTimeConvertError=Caught an error converting a String to a java.sql.Time: {0}
\ No newline at end of file
+TypeUtils_javaSqlTimeConvertError=Caught an error converting a String to a java.sql.Time: {0}
+URLCodec_encodeException=Caught exception encoding a String. Cause: {0}
+URLCodec_decodeException=Caught exception decoding a String. Cause: {0}
\ No newline at end of file