You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by cm...@apache.org on 2002/02/24 23:21:21 UTC
cvs commit: jakarta-slide/src/util/org/apache/util URLUtil.java
cmlenz 02/02/24 14:21:21
Modified: src/util/org/apache/util Tag: SLIDE_1_0 URLUtil.java
Log:
Porting bugfixes/enhancements from the HEAD branch:
- Commited by juergen, 02/01/22 05:39:29
"move/copy with a '+' in the URL is now possible"
Revision Changes Path
No revision
No revision
1.2.2.1 +12 -11 jakarta-slide/src/util/org/apache/util/URLUtil.java
Index: URLUtil.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/util/org/apache/util/URLUtil.java,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -r1.2 -r1.2.2.1
--- URLUtil.java 13 Aug 2001 17:06:51 -0000 1.2
+++ URLUtil.java 24 Feb 2002 22:21:21 -0000 1.2.2.1
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/util/org/apache/util/URLUtil.java,v 1.2 2001/08/13 17:06:51 dirkv Exp $
- * $Revision: 1.2 $
- * $Date: 2001/08/13 17:06:51 $
+ * $Header: /home/cvs/jakarta-slide/src/util/org/apache/util/URLUtil.java,v 1.2.2.1 2002/02/24 22:21:21 cmlenz Exp $
+ * $Revision: 1.2.2.1 $
+ * $Date: 2002/02/24 22:21:21 $
*
* ====================================================================
*
@@ -82,7 +82,7 @@
* @author Craig R. McClanahan
* @author Tim Tye
* @author Remy Maucherat
- * @version $Revision: 1.2 $ $Date: 2001/08/13 17:06:51 $
+ * @version $Revision: 1.2.2.1 $ $Date: 2002/02/24 22:21:21 $
*/
public final class URLUtil {
@@ -104,8 +104,8 @@
protected static BitSet safeCharacters;
- protected static final char[] hexadecimal =
- {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+ protected static final char[] hexadecimal =
+ {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F'};
@@ -218,12 +218,14 @@
int ox = 0;
while (ix < len) {
byte b = bytes[ix++]; // Get byte to test
- if (b == '+') {
- b = (byte)' ';
- } else if (b == '%') {
+ if (b == '%') {
b = (byte) ((convertHexDigit(bytes[ix++]) << 4)
+ convertHexDigit(bytes[ix++]));
}
+ if (b == '+') {
+ b = (byte)' ';
+ }
+
bytes[ox++] = b;
}
if (enc != null) {
@@ -253,7 +255,7 @@
/**
* URL rewriter.
- *
+ *
* @param path Path which has to be rewiten
*/
public static String URLEncode(String path, String enc) {
@@ -266,7 +268,6 @@
*/
int maxBytesPerChar = 10;
- int caseDiff = ('a' - 'A');
StringBuffer rewrittenPath = new StringBuffer(path.length());
ByteArrayOutputStream buf = new ByteArrayOutputStream(maxBytesPerChar);
OutputStreamWriter writer = null;
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>