Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Bartel2012-08-03 07:25:24 +0000
committerJan Bartel2012-08-03 07:25:24 +0000
commitc0dd05683bc39551bae04630685d7988447b5d87 (patch)
tree79f41f6ce61d78cce8f9610be87c9909d6775aac /jetty-http
parentc67b2d89c071d4316e1ae4b4ad25c488562b7c3e (diff)
parent3f0756427438dabf481a48a62a94ad4d41b47e79 (diff)
downloadorg.eclipse.jetty.project-c0dd05683bc39551bae04630685d7988447b5d87.tar.gz
org.eclipse.jetty.project-c0dd05683bc39551bae04630685d7988447b5d87.tar.xz
org.eclipse.jetty.project-c0dd05683bc39551bae04630685d7988447b5d87.zip
Merge remote-tracking branch 'origin/master' into jetty-8
Diffstat (limited to 'jetty-http')
-rw-r--r--jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java49
1 files changed, 49 insertions, 0 deletions
diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java
index 1acad63d88..64f981651e 100644
--- a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java
+++ b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java
@@ -581,6 +581,55 @@ public class HttpURI
_utf8b.append(bytes,0,n);
return _utf8b.toString();
}
+
+
+ public String getDecodedPath(String encoding)
+ {
+ if (_path==_param)
+ return null;
+
+ int length = _param-_path;
+ byte[] bytes=null;
+ int n=0;
+
+ for (int i=_path;i<_param;i++)
+ {
+ byte b = _raw[i];
+
+ if (b=='%')
+ {
+ if ((i+2)>=_param)
+ throw new IllegalArgumentException("Bad % encoding: "+this);
+ b=(byte)(0xff&TypeUtil.parseInt(_raw,i+1,2,16));
+ i+=2;
+ }
+ else if (bytes==null)
+ {
+ n++;
+ continue;
+ }
+
+ if (bytes==null)
+ {
+ bytes=new byte[length];
+ System.arraycopy(_raw,_path,bytes,0,n);
+ }
+
+ bytes[n++]=b;
+ }
+
+
+ if (bytes==null)
+ return StringUtil.toString(_raw,_path,_param-_path,encoding);
+
+ return StringUtil.toString(bytes,0,n,encoding);
+ }
+
+
+
+
+
+
public String getPathAndParam()
{

Back to the top