commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1085209 - in /commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp: FTPClient.java FTPListParseEngine.java FTPSClient.java FTPSSocketFactory.java FTPSTrustManager.java parser/VMSFTPEntryParser.java
Date Fri, 25 Mar 2011 00:08:04 GMT
Author: sebb
Date: Fri Mar 25 00:08:04 2011
New Revision: 1085209

URL: http://svn.apache.org/viewvc?rev=1085209&view=rev
Log:
Restore deprecated methods to ensure binary compatibility

Added:
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSTrustManager.java
  (with props)
Modified:
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPListParseEngine.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSSocketFactory.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java?rev=1085209&r1=1085208&r2=1085209&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java Fri Mar
25 00:08:04 2011
@@ -3325,6 +3325,18 @@ implements Configurable
         return __autodetectEncoding;
     }
 
+    // DEPRECATED METHODS - for API compatibility only - DO NOT USE
+
+    /**
+     * @deprecated, use {@link #getSystemType()} instead
+     */
+    @Deprecated
+    public String getSystemName() throws IOException
+    {
+        if (__systemName == null && FTPReply.isPositiveCompletion(syst()))
+            __systemName = _replyLines.get(_replyLines.size() - 1).substring(4);
+        return __systemName;
+    }
 }
 
 /* Emacs configuration

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPListParseEngine.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPListParseEngine.java?rev=1085209&r1=1085208&r2=1085209&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPListParseEngine.java
(original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPListParseEngine.java
Fri Mar 25 00:08:04 2011
@@ -290,4 +290,18 @@ public class FTPListParseEngine {
     public void resetIterator() {
         this._internalIterator = this.entries.listIterator();
     }
+
+    // DEPRECATED METHODS - for API compatibility only - DO NOT USE
+
+    /**
+     * Do not use.
+     * @deprecated use {@link #readServerList(InputStream, String)} instead
+    */
+    @Deprecated
+    public void readServerList(InputStream stream)
+    throws IOException
+    {
+        readServerList(stream, null);
+    }
+
 }

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java?rev=1085209&r1=1085208&r2=1085209&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java Fri
Mar 25 00:08:04 2011
@@ -560,5 +560,24 @@ public class FTPSClient extends FTPClien
         setSocketFactory(null);
         setServerSocketFactory(null);
     }
+
+    // DEPRECATED - for API compatibility only - DO NOT USE
+
+    /** @deprecated - not used - may be removed in a future release */
+    @Deprecated
+    public static String KEYSTORE_ALGORITHM;
+
+    /** @deprecated - not used - may be removed in a future release */
+    @Deprecated
+    public static String TRUSTSTORE_ALGORITHM;
+
+    /** @deprecated - not used - may be removed in a future release */
+    @Deprecated
+    public static String PROVIDER;
+
+    /** @deprecated - not used - may be removed in a future release */
+    @Deprecated
+    public static String STORE_TYPE;
+
 }
 /* kate: indent-width 4; replace-tabs on; */

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSSocketFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSSocketFactory.java?rev=1085209&r1=1085208&r2=1085209&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSSocketFactory.java
(original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSSocketFactory.java
Fri Mar 25 00:08:04 2011
@@ -58,4 +58,34 @@ public class FTPSSocketFactory extends S
     public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int
localPort) throws IOException {
         return this.context.getSocketFactory().createSocket(address, port, localAddress,
localPort);
     }
+
+
+    // DEPRECATED METHODS - for API compatibility only - DO NOT USE
+
+    /** @deprecated (2.2) use {@link FTPSServerSocketFactory#createServerSocket(int) instead}
*/
+    @Deprecated
+    public java.net.ServerSocket createServerSocket(int port) throws IOException {
+        return this.init(this.context.getServerSocketFactory().createServerSocket(port));
+    }
+
+    /** @deprecated  (2.2) use {@link FTPSServerSocketFactory#createServerSocket(int, int)
instead} */
+    @Deprecated
+    public java.net.ServerSocket createServerSocket(int port, int backlog) throws IOException
{
+        return this.init(this.context.getServerSocketFactory().createServerSocket(port, backlog));
+    }
+
+    /** @deprecated  (2.2) use {@link FTPSServerSocketFactory#createServerSocket(int, int,
InetAddress) instead} */
+    @Deprecated
+    public java.net.ServerSocket createServerSocket(int port, int backlog, InetAddress ifAddress)
throws IOException {
+        return this.init(this.context.getServerSocketFactory().createServerSocket(port, backlog,
ifAddress));
+    }
+        
+    /** @deprecated  (2.2) use {@link FTPSServerSocketFactory#init(java.net.ServerSocket)}
*/
+    @SuppressWarnings("unused")
+    @Deprecated
+    public java.net.ServerSocket init(java.net.ServerSocket socket) throws IOException {
+        ((javax.net.ssl.SSLServerSocket) socket).setUseClientMode(true);
+        return socket;
+    }
+
 }

Added: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSTrustManager.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSTrustManager.java?rev=1085209&view=auto
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSTrustManager.java
(added)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSTrustManager.java
Fri Mar 25 00:08:04 2011
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.net.ftp;
+
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+
+import javax.net.ssl.X509TrustManager;
+
+import org.apache.commons.net.util.TrustManagerUtils;
+
+/**
+ * Do not use.
+ * @since 2.0
+ * @deprecated 3.0 use {@link TrustManagerUtils#getValidateServerCertificateTrustManager()}
instead
+ */
+@Deprecated
+public class FTPSTrustManager implements X509TrustManager
+{
+    private static final X509Certificate[] EMPTY_X509CERTIFICATE_ARRAY = new X509Certificate[]{};
+
+    /**
+     * No-op
+     */
+    public void checkClientTrusted(X509Certificate[] certificates, String authType)
+    {
+        return;
+    }
+
+    public void checkServerTrusted(X509Certificate[] certificates, String authType) throws
CertificateException
+    {
+        for (int i = 0; i < certificates.length; ++i)
+        {
+            certificates[i].checkValidity();
+        }
+    }
+
+    public X509Certificate[] getAcceptedIssuers()
+    {
+        return EMPTY_X509CERTIFICATE_ARRAY;
+    }
+}

Propchange: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSTrustManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSTrustManager.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java?rev=1085209&r1=1085208&r2=1085209&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java
(original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java
Fri Mar 25 00:08:04 2011
@@ -250,6 +250,18 @@ public class VMSFTPEntryParser extends C
                 null, null, null, null);
     }
 
+    // DEPRECATED METHODS - for API compatibility only - DO NOT USE
+
+    /**
+     * DO NOT USE
+     * @deprecated (2.2) No other FTPFileEntryParser implementations have this method.
+     */
+    @Deprecated
+    public FTPFile[] parseFileList(java.io.InputStream listStream) throws IOException {
+        org.apache.commons.net.ftp.FTPListParseEngine engine = new org.apache.commons.net.ftp.FTPListParseEngine(this);
+        engine.readServerList(listStream, null);
+        return engine.getFiles();
+    }
 
 }
 



Mime
View raw message