Author: sebb
Date: Tue Mar 23 20:20:41 2010
New Revision: 926765
URL: http://svn.apache.org/viewvc?rev=926765&view=rev
Log:
Restore backward compatibility (lost in r740961)
Modified:
commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPSSocketFactory.java
Modified:
commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPSSocketFactory.java
URL:
http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPSSocketFactory.java?rev=926765&r1=926764&r2=926765&view=diff
==============================================================================
---
commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPSSocketFactory.java
(original)
+++
commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/ftp/FTPSSocketFactory.java
Tue Mar 23 20:20:41 2010
@@ -19,11 +19,13 @@ package org.apache.commons.net.ftp;
import java.io.IOException;
import java.net.InetAddress;
+import java.net.ServerSocket;
import java.net.Socket;
import java.net.UnknownHostException;
import javax.net.SocketFactory;
import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLServerSocket;
/**
*
@@ -58,4 +60,29 @@ 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 use {...@link
FTPSServerSocketFactory#createServerSocket(int) instead} */
+ @Deprecated
+ public ServerSocket createServerSocket(int port) throws IOException {
+ return
this.init(this.context.getServerSocketFactory().createServerSocket(port));
+ }
+
+ /** @deprecated use {...@link
FTPSServerSocketFactory#createServerSocket(int, int) instead} */
+ @Deprecated
+ public ServerSocket createServerSocket(int port, int backlog) throws
IOException {
+ return
this.init(this.context.getServerSocketFactory().createServerSocket(port,
backlog));
+ }
+
+ /** @deprecated use {...@link
FTPSServerSocketFactory#createServerSocket(int, int, InetAddress) instead} */
+ @Deprecated
+ public ServerSocket createServerSocket(int port, int backlog, InetAddress
ifAddress) throws IOException {
+ return
this.init(this.context.getServerSocketFactory().createServerSocket(port,
backlog, ifAddress));
+ }
+
+ /** @deprecated use {...@link FTPSServerSocketFactory#init(ServerSocket)}
*/
+ @Deprecated
+ public ServerSocket init(ServerSocket socket) throws IOException {
+ ((SSLServerSocket) socket).setUseClientMode(true);
+ return socket;
+ }
}