jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1771091 - in /jackrabbit/branches/2.8: ./ jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/ jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/
Date Thu, 24 Nov 2016 09:01:32 GMT
Author: reschke
Date: Thu Nov 24 09:01:31 2016
New Revision: 1771091

URL: http://svn.apache.org/viewvc?rev=1771091&view=rev
Log:
JCR-4059: avoid use of HttpClient3 URI class (ported to 2.8)

Modified:
    jackrabbit/branches/2.8/   (props changed)
    jackrabbit/branches/2.8/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
    jackrabbit/branches/2.8/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/URIResolverImpl.java
    jackrabbit/branches/2.8/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java

Propchange: jackrabbit/branches/2.8/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Nov 24 09:01:31 2016
@@ -1,3 +1,3 @@
 /jackrabbit/branches/JCR-2272:1173165-1176545
 /jackrabbit/sandbox/JCR-2415-lucene-3.0:1060860-1064038
-/jackrabbit/trunk:1592881,1597717,1597799,1597806,1598035,1598058,1603769,1603934,1609712,1625561,1634584,1653275,1667787,1674859,1680757,1709811,1729382,1732436,1740814-1740815,1751279,1752165,1758600,1759607,1759782,1759865,1761679,1761909,1762422,1763558,1766398
+/jackrabbit/trunk:1592881,1597717,1597799,1597806,1598035,1598058,1603769,1603934,1609712,1625561,1634584,1653275,1667787,1674859,1680757,1709811,1729382,1732436,1740814-1740815,1751279,1752165,1758600,1759607,1759782,1759865,1761679,1761909,1762422,1763558,1766398,1771078

Modified: jackrabbit/branches/2.8/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.8/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java?rev=1771091&r1=1771090&r2=1771091&view=diff
==============================================================================
--- jackrabbit/branches/2.8/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
(original)
+++ jackrabbit/branches/2.8/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
Thu Nov 24 09:01:31 2016
@@ -22,6 +22,7 @@ import java.io.InputStreamReader;
 import java.io.Reader;
 import java.io.StringWriter;
 import java.io.UnsupportedEncodingException;
+import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -67,8 +68,6 @@ import org.apache.commons.httpclient.Htt
 import org.apache.commons.httpclient.HttpMethod;
 import org.apache.commons.httpclient.HttpStatus;
 import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
-import org.apache.commons.httpclient.URI;
-import org.apache.commons.httpclient.URIException;
 import org.apache.commons.httpclient.auth.AuthScope;
 import org.apache.commons.httpclient.methods.GetMethod;
 import org.apache.commons.httpclient.methods.HeadMethod;
@@ -326,14 +325,14 @@ public class RepositoryServiceImpl imple
         try {
             URI repositoryUri = computeRepositoryUri(uri);
             hostConfig = new HostConfiguration();
-            hostConfig.setHost(repositoryUri);
+            hostConfig.setHost(repositoryUri.toASCIIString());
 
             nsCache = new NamespaceCache();
             uriResolver = new URIResolverImpl(repositoryUri, this, DomUtil.createDocument());
             NamePathResolver resolver = new NamePathResolverImpl(nsCache);
             valueFactory = new ValueFactoryQImpl(qValueFactory, resolver);
 
-        } catch (URIException e) {
+        } catch (URISyntaxException e) {
             throw new RepositoryException(e);
         } catch (ParserConfigurationException e) {
             throw new RepositoryException(e);
@@ -2660,8 +2659,8 @@ public class RepositoryServiceImpl imple
      * Compute the repository URI (while dealing with trailing / and port number
      * defaulting)
      */
-    public static URI computeRepositoryUri(String uri) throws URIException {
-        URI repositoryUri = new URI((uri.endsWith("/")) ? uri : uri + "/", true);
+    public static URI computeRepositoryUri(String uri) throws URISyntaxException {
+        URI repositoryUri = URI.create((uri.endsWith("/")) ? uri : uri + "/");
         // workaround for JCR-3228: normalize default port numbers because of
         // the weak URI matching code elsewhere (the remote server is unlikely
         // to include the port number in URIs when it's the default for the
@@ -2669,7 +2668,7 @@ public class RepositoryServiceImpl imple
         boolean useDefaultPort = ("http".equalsIgnoreCase(repositoryUri.getScheme()) &&
repositoryUri.getPort() == 80)
                 || (("https".equalsIgnoreCase(repositoryUri.getScheme()) && repositoryUri.getPort()
== 443));
         if (useDefaultPort) {
-            repositoryUri = new URI(repositoryUri.getScheme(), repositoryUri.getUserinfo(),
repositoryUri.getHost(), -1,
+            repositoryUri = new URI(repositoryUri.getScheme(), repositoryUri.getUserInfo(),
repositoryUri.getHost(), -1,
                     repositoryUri.getPath(), repositoryUri.getQuery(), repositoryUri.getFragment());
         }
 

Modified: jackrabbit/branches/2.8/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/URIResolverImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.8/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/URIResolverImpl.java?rev=1771091&r1=1771090&r2=1771091&view=diff
==============================================================================
--- jackrabbit/branches/2.8/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/URIResolverImpl.java
(original)
+++ jackrabbit/branches/2.8/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/URIResolverImpl.java
Thu Nov 24 09:01:31 2016
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.spi2dav;
 
-import org.apache.commons.httpclient.URI;
 import org.apache.jackrabbit.commons.webdav.JcrRemotingConstants;
 import org.apache.jackrabbit.spi.commons.conversion.NameException;
 import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
@@ -45,6 +44,7 @@ import org.w3c.dom.Document;
 import javax.jcr.ItemNotFoundException;
 import javax.jcr.RepositoryException;
 import java.io.IOException;
+import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.HashMap;
 import java.util.Map;
@@ -79,7 +79,7 @@ class URIResolverImpl implements URIReso
     }
 
     String getRepositoryUri() {
-        return repositoryUri.getEscapedURI();
+        return repositoryUri.toASCIIString();
     }
 
     String getWorkspaceUri(String workspaceName) {

Modified: jackrabbit/branches/2.8/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.8/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java?rev=1771091&r1=1771090&r2=1771091&view=diff
==============================================================================
--- jackrabbit/branches/2.8/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java
(original)
+++ jackrabbit/branches/2.8/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java
Thu Nov 24 09:01:31 2016
@@ -18,6 +18,8 @@ package org.apache.jackrabbit.spi2davex;
 
 import java.io.IOException;
 import java.io.StringWriter;
+import java.net.URI;
+import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -31,8 +33,6 @@ import javax.jcr.RepositoryException;
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.HttpException;
 import org.apache.commons.httpclient.HttpMethod;
-import org.apache.commons.httpclient.URI;
-import org.apache.commons.httpclient.URIException;
 import org.apache.commons.httpclient.methods.RequestEntity;
 import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity;
 import org.apache.commons.httpclient.methods.multipart.Part;
@@ -195,7 +195,7 @@ public class RepositoryServiceImpl exten
         try {
             URI repositoryUri = computeRepositoryUri(jcrServerURI);
             this.jcrServerURI = repositoryUri.toString();
-        } catch (URIException e) {
+        } catch (URISyntaxException e) {
             throw new RepositoryException(e);
         }
 



Mime
View raw message