commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject svn commit: r452599 - in /jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs: impl/ provider/http/ provider/https/
Date Tue, 03 Oct 2006 19:21:18 GMT
Author: imario
Date: Tue Oct  3 12:21:17 2006
New Revision: 452599

URL: http://svn.apache.org/viewvc?view=rev&rev=452599
Log:
VFS-80: added https (inherited from http)

Added:
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/https/
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/https/HttpsFileNameParser.java
  (with props)
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/https/HttpsFileProvider.java
  (with props)
Modified:
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/impl/providers.xml
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/http/HttpClientFactory.java
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/http/HttpFileProvider.java

Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/impl/providers.xml
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/impl/providers.xml?view=diff&rev=452599&r1=452598&r2=452599
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/impl/providers.xml (original)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/impl/providers.xml Tue
Oct  3 12:21:17 2006
@@ -43,6 +43,10 @@
         <scheme name="http"/>
         <if-available class-name="org.apache.commons.httpclient.HttpClient"/>
     </provider>
+    <provider class-name="org.apache.commons.vfs.provider.https.HttpsFileProvider">
+        <scheme name="https"/>
+        <if-available class-name="org.apache.commons.httpclient.HttpClient"/>
+    </provider>
     <provider class-name="org.apache.commons.vfs.provider.webdav.WebdavFileProvider">
         <scheme name="webdav"/>
         <if-available class-name="org.apache.webdav.lib.WebdavResource"/>

Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/http/HttpClientFactory.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/http/HttpClientFactory.java?view=diff&rev=452599&r1=452598&r2=452599
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/http/HttpClientFactory.java
(original)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/http/HttpClientFactory.java
Tue Oct  3 12:21:17 2006
@@ -42,14 +42,14 @@
     /**
      * Creates a new connection to the server.
      */
-    public static HttpClient createConnection(String hostname, int port, String username,
String password, FileSystemOptions fileSystemOptions) throws FileSystemException
+    public static HttpClient createConnection(String scheme, String hostname, int port, String
username, String password, FileSystemOptions fileSystemOptions) throws FileSystemException
     {
         HttpClient client;
         try
         {
             client = new HttpClient(new MultiThreadedHttpConnectionManager());
             final HostConfiguration config = new HostConfiguration();
-            config.setHost(hostname, port);
+            config.setHost(hostname, port, scheme);
 
             if (fileSystemOptions != null)
             {

Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/http/HttpFileProvider.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/http/HttpFileProvider.java?view=diff&rev=452599&r1=452598&r2=452599
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/http/HttpFileProvider.java
(original)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/http/HttpFileProvider.java
Tue Oct  3 12:21:17 2006
@@ -77,7 +77,9 @@
 		{
 			authData = UserAuthenticatorUtils.authenticate(fileSystemOptions, AUTHENTICATOR_TYPES);
 
-			httpClient = HttpClientFactory.createConnection(rootName.getHostName(),
+			httpClient = HttpClientFactory.createConnection(
+                rootName.getScheme(),
+                rootName.getHostName(),
 				rootName.getPort(),
 				UserAuthenticatorUtils.toString(UserAuthenticatorUtils.getData(authData, UserAuthenticationData.USERNAME,
UserAuthenticatorUtils.toChar(rootName.getUserName()))),
 				UserAuthenticatorUtils.toString(UserAuthenticatorUtils.getData(authData, UserAuthenticationData.PASSWORD,
UserAuthenticatorUtils.toChar(rootName.getPassword()))),

Added: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/https/HttpsFileNameParser.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/https/HttpsFileNameParser.java?view=auto&rev=452599
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/https/HttpsFileNameParser.java
(added)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/https/HttpsFileNameParser.java
Tue Oct  3 12:21:17 2006
@@ -0,0 +1,23 @@
+package org.apache.commons.vfs.provider.https;
+
+import org.apache.commons.vfs.provider.URLFileNameParser;
+import org.apache.commons.vfs.provider.FileNameParser;
+import org.apache.commons.vfs.provider.http.HttpFileNameParser;
+
+/**
+ * Implementation for http. set default port to 80
+ */
+public class HttpsFileNameParser extends URLFileNameParser
+{
+    private final static HttpsFileNameParser INSTANCE = new HttpsFileNameParser();
+
+    public HttpsFileNameParser()
+    {
+        super(443);
+    }
+
+    public static FileNameParser getInstance()
+    {
+        return INSTANCE;
+    }
+}

Propchange: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/https/HttpsFileNameParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/https/HttpsFileNameParser.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/https/HttpsFileNameParser.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/https/HttpsFileProvider.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/https/HttpsFileProvider.java?view=auto&rev=452599
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/https/HttpsFileProvider.java
(added)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/https/HttpsFileProvider.java
Tue Oct  3 12:21:17 2006
@@ -0,0 +1,19 @@
+package org.apache.commons.vfs.provider.https;
+
+import org.apache.commons.vfs.provider.http.HttpFileProvider;
+
+/**
+ * An HTTPS provider that uses commons-httpclient.
+ *
+ * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
+ * @version $Revision$ $Date$
+ */
+public class HttpsFileProvider
+    extends HttpFileProvider
+{
+	public HttpsFileProvider()
+    {
+        super();
+        setFileNameParser(HttpsFileNameParser.getInstance());
+    }
+}

Propchange: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/https/HttpsFileProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/https/HttpsFileProvider.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/https/HttpsFileProvider.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message