hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r645072 - in /httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http: client/utils/URIUtils.java client/utils/URLUtils.java impl/client/DefaultClientRequestDirector.java impl/client/DefaultRedirectHandler.java
Date Sat, 05 Apr 2008 10:54:13 GMT
Author: olegk
Date: Sat Apr  5 03:54:12 2008
New Revision: 645072

URL: http://svn.apache.org/viewvc?rev=645072&view=rev
Log:
HTTPCLIENT-746: Refactored URLUtils into URLEncodedUtils and URIUtils
Contributed by Stojce Dimski <sdmiski at yahoo.it>
Reviewed by Oleg Kalnichevski

Added:
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/utils/URIUtils.java
      - copied, changed from r645071, httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/utils/URLUtils.java
Removed:
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/utils/URLUtils.java
Modified:
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultRedirectHandler.java

Copied: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/utils/URIUtils.java
(from r645071, httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/utils/URLUtils.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/utils/URIUtils.java?p2=httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/utils/URIUtils.java&p1=httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/utils/URLUtils.java&r1=645071&r2=645072&rev=645072&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/utils/URLUtils.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/utils/URIUtils.java
Sat Apr  5 03:54:12 2008
@@ -34,7 +34,7 @@
 
 import org.apache.http.HttpHost;
 
-public class URLUtils {
+public class URIUtils {
 
      public static URI createURI(
             final String scheme,
@@ -81,7 +81,7 @@
             throw new IllegalArgumentException("URI may nor be null");
         }
         if (target != null) {
-            return URLUtils.createURI(
+            return URIUtils.createURI(
                     target.getSchemeName(), 
                     target.getHostName(), 
                     target.getPort(), 
@@ -89,7 +89,7 @@
                     uri.getRawQuery(), 
                     dropFragment ? null : uri.getRawFragment());
         } else {
-            return URLUtils.createURI(
+            return URIUtils.createURI(
                     null, 
                     null, 
                     -1, 
@@ -114,7 +114,7 @@
      * @return the resulting URI
      */
     public static URI resolve(final URI baseURI, final String reference) {
-        return URLUtils.resolve(baseURI, URI.create(reference));
+        return URIUtils.resolve(baseURI, URI.create(reference));
     }
 
     /**
@@ -148,7 +148,7 @@
     /**
      * This class should not be instantiated.
      */
-    private URLUtils() {
+    private URIUtils() {
     }
 
 }

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java?rev=645072&r1=645071&r2=645072&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java
Sat Apr  5 03:54:12 2008
@@ -67,7 +67,7 @@
 import org.apache.http.client.params.ClientPNames;
 import org.apache.http.client.params.HttpClientParams;
 import org.apache.http.client.protocol.ClientContext;
-import org.apache.http.client.utils.URLUtils;
+import org.apache.http.client.utils.URIUtils;
 import org.apache.http.conn.BasicManagedEntity;
 import org.apache.http.conn.ClientConnectionManager;
 import org.apache.http.conn.ClientConnectionRequest;
@@ -241,13 +241,13 @@
                 // Make sure the request URI is absolute
                 if (!uri.isAbsolute()) {
                     HttpHost target = route.getTargetHost();
-                    uri = URLUtils.rewriteURI(uri, target);
+                    uri = URIUtils.rewriteURI(uri, target);
                     request.setURI(uri);
                 }
             } else {
                 // Make sure the request URI is relative
                 if (uri.isAbsolute()) {
-                    uri = URLUtils.rewriteURI(uri, null);
+                    uri = URIUtils.rewriteURI(uri, null);
                     request.setURI(uri);
                 }
             }

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultRedirectHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultRedirectHandler.java?rev=645072&r1=645071&r2=645072&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultRedirectHandler.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultRedirectHandler.java
Sat Apr  5 03:54:12 2008
@@ -45,7 +45,7 @@
 import org.apache.http.client.CircularRedirectException;
 import org.apache.http.client.RedirectHandler;
 import org.apache.http.client.params.ClientPNames;
-import org.apache.http.client.utils.URLUtils;
+import org.apache.http.client.utils.URIUtils;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.ExecutionContext;
@@ -137,8 +137,8 @@
             
             try {
                 URI requestURI = new URI(request.getRequestLine().getUri());
-                URI absoluteRequestURI = URLUtils.rewriteURI(requestURI, target, true);
-                uri = URLUtils.resolve(absoluteRequestURI, uri); 
+                URI absoluteRequestURI = URIUtils.rewriteURI(requestURI, target, true);
+                uri = URIUtils.resolve(absoluteRequestURI, uri); 
             } catch (URISyntaxException ex) {
                 throw new ProtocolException(ex.getMessage(), ex);
             }
@@ -161,7 +161,7 @@
                             uri.getHost(), 
                             uri.getPort(),
                             uri.getScheme());
-                    redirectURI = URLUtils.rewriteURI(uri, target, true);
+                    redirectURI = URIUtils.rewriteURI(uri, target, true);
                 } catch (URISyntaxException ex) {
                     throw new ProtocolException(ex.getMessage(), ex);
                 }



Mime
View raw message