incubator-ftpserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r498135 - in /incubator/ftpserver/trunk: core/src/java/org/apache/ftpserver/ core/src/java/org/apache/ftpserver/command/ core/src/java/org/apache/ftpserver/listener/ core/src/java/org/apache/ftpserver/listener/io/ core/src/java/org/apache/f...
Date Sat, 20 Jan 2007 16:09:27 GMT
Author: ngn
Date: Sat Jan 20 08:09:22 2007
New Revision: 498135

URL: http://svn.apache.org/viewvc?view=rev&rev=498135
Log:
Refactored FtpDataConnection to take care of data transfer (was previsoulsy done in Connection).
This also hides the use of blocking sockets in FtpDataConnection and enables us to use MINA for the data connection in the future.

Added:
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpDataConnectionFactory.java
      - copied, changed from r497032, incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpDataConnection.java
Removed:
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpDataConnection.java
Modified:
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpSessionImpl.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/APPE.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/EPSV.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/LIST.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLSD.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/NLST.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PASV.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PROT.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RETR.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNFR.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOR.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOU.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/AbstractConnection.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/Connection.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/ConnectionManagerImpl.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOConnection.java
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/mina/MinaConnection.java
    incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/clienttests/StoreTest.java
    incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/FtpSession.java

Copied: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpDataConnectionFactory.java (from r497032, incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpDataConnection.java)
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpDataConnectionFactory.java?view=diff&rev=498135&p1=incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpDataConnection.java&r1=497032&p2=incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpDataConnectionFactory.java&r2=498135
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpDataConnection.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpDataConnectionFactory.java Sat Jan 20 08:09:22 2007
@@ -25,6 +25,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.ftplet.FtpSession;
 import org.apache.ftpserver.interfaces.DataConnectionConfig;
 import org.apache.ftpserver.interfaces.FtpServerContext;
 import org.apache.ftpserver.interfaces.Ssl;
@@ -37,7 +38,7 @@
  * @author <a href="mailto:rana_b@yahoo.com">Rana Bhattacharyya</a>
  */
 public
-class FtpDataConnection {
+class FtpDataConnectionFactory {
     
     private Log log;
     
@@ -57,15 +58,16 @@
     private boolean isZip    = false;
 
     private InetAddress serverControlAddress;
+
+    private FtpSessionImpl session;
     
-    
-    /**
-     * Set the ftp config.
-     */
-    public void setServerContext(FtpServerContext serverContext) {
+    public FtpDataConnectionFactory(FtpServerContext serverContext, FtpSessionImpl session) {
+        this.session = session;
         this.serverContext = serverContext;
         log = serverContext.getLogFactory().getInstance(getClass());
+        
     }
+
     
     /**
      * Close data socket.
@@ -189,10 +191,14 @@
         return port;
     }
 
+    public FtpDataConnection openConnection() throws Exception {
+        return new FtpDataConnection(getDataSocket(), session, this);
+    }
+    
     /**
      * Get the data socket. In case of error returns null.
      */
-    public synchronized Socket getDataSocket() {
+    public synchronized Socket getDataSocket() throws Exception {
 
         // get socket depending on the selection
         dataSoc = null;
@@ -230,6 +236,7 @@
         catch(Exception ex) {
             closeDataSocket();
             log.warn("FtpDataConnection.getDataSocket()", ex);
+            throw ex;
         }
         
         return dataSoc;

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpSessionImpl.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpSessionImpl.java?view=diff&rev=498135&r1=498134&r2=498135
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpSessionImpl.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/FtpSessionImpl.java Sat Jan 20 08:09:22 2007
@@ -19,16 +19,10 @@
 
 package org.apache.ftpserver;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
 import java.net.InetAddress;
-import java.net.Socket;
 import java.security.cert.Certificate;
 import java.util.Date;
 import java.util.HashMap;
-import java.util.zip.DeflaterOutputStream;
-import java.util.zip.InflaterInputStream;
 
 import org.apache.ftpserver.ftplet.DataType;
 import org.apache.ftpserver.ftplet.FileObject;
@@ -59,7 +53,7 @@
     private long loginTime = 0L;
     private long lastAccessTime = 0L;
     
-    private FtpDataConnection dataConnection;
+    private FtpDataConnectionFactory dataConnection;
     private FileSystemView fileSystemView;
     
     private FileObject renameFrom;
@@ -89,7 +83,7 @@
     /**
      * Set FTP data connection.
      */
-    public void setFtpDataConnection(FtpDataConnection dataCon) {
+    public void setFtpDataConnection(FtpDataConnectionFactory dataCon) {
         dataConnection = dataCon;
     }
     
@@ -146,7 +140,7 @@
     /**
      * Get FTP data connection.
      */
-    public FtpDataConnection getFtpDataConnection() {
+    public FtpDataConnectionFactory getFtpDataConnection() {
         return dataConnection;
     }
     
@@ -255,55 +249,7 @@
         return remoteAddr;
     }
     
-    /**
-     * Get data input stream. The return value will never be null.
-     */
-    public InputStream getDataInputStream() throws IOException {
-        try {
-            
-            // get data socket
-            Socket dataSoc = dataConnection.getDataSocket();
-            if(dataSoc == null) {
-                throw new IOException("Cannot open data connection.");
-            }
-            
-            // create input stream
-            InputStream is = dataSoc.getInputStream();
-            if(dataConnection.isZipMode()) {
-                is = new InflaterInputStream(is);
-            }
-            return is;
-        }
-        catch(IOException ex) {
-            dataConnection.closeDataSocket();
-            throw ex;
-        }
-    }
-    
-    /**
-     * Get data output stream. The return value will never be null.
-     */
-    public OutputStream getDataOutputStream() throws IOException {
-        try {
-            
-            // get data socket
-            Socket dataSoc = dataConnection.getDataSocket();
-            if(dataSoc == null) {
-                throw new IOException("Cannot open data connection.");
-            }
-            
-            // create output stream
-            OutputStream os = dataSoc.getOutputStream();
-            if(dataConnection.isZipMode()) {
-                os = new DeflaterOutputStream(os);
-            }
-            return os;
-        }
-        catch(IOException ex) {
-            dataConnection.closeDataSocket();
-            throw ex;
-        }
-    }
+
     
     /**
      * Get attribute

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/APPE.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/APPE.java?view=diff&rev=498135&r1=498134&r2=498135
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/APPE.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/APPE.java Sat Jan 20 08:09:22 2007
@@ -19,13 +19,12 @@
 
 package org.apache.ftpserver.command;
 
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
 import java.io.IOException;
-import java.io.InputStream;
+import java.io.OutputStream;
 import java.net.SocketException;
 
 import org.apache.commons.logging.Log;
+import org.apache.ftpserver.FtpDataConnection;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.ftplet.FileObject;
@@ -37,7 +36,6 @@
 import org.apache.ftpserver.interfaces.FtpServerContext;
 import org.apache.ftpserver.interfaces.ServerFtpStatistics;
 import org.apache.ftpserver.listener.Connection;
-import org.apache.ftpserver.usermanager.TransferRateRequest;
 import org.apache.ftpserver.util.IoUtils;
 
 /**
@@ -121,11 +119,11 @@
             
             // get data connection
             out.send(FtpResponse.REPLY_150_FILE_STATUS_OKAY, "APPE", fileName);
-            InputStream is = null;
+            
+            FtpDataConnection dataConnection;
             try {
-                is = session.getDataInputStream();
-            }
-            catch(IOException e) {
+                dataConnection = session.getFtpDataConnection().openConnection();
+            } catch (Exception e) {
                 log.debug("Exception when getting data input stream", e);
                 out.send(FtpResponse.REPLY_425_CANT_OPEN_DATA_CONNECTION, "APPE", fileName);
                 return;
@@ -133,8 +131,7 @@
              
             // get data from client
             boolean failure = false;
-            BufferedInputStream bis = null;
-            BufferedOutputStream bos = null;
+            OutputStream os = null;
             try {
                 
             	// find offset
@@ -144,20 +141,10 @@
             	}
             	
                 // open streams
-                bis = IoUtils.getBufferedInputStream(is);
-                bos = IoUtils.getBufferedOutputStream( file.createOutputStream(offset) );
+                os = file.createOutputStream(offset);
                     
                 // transfer data
-                
-                TransferRateRequest transferRateRequest = new TransferRateRequest();
-                transferRateRequest = (TransferRateRequest) session.getUser().authorize(transferRateRequest);
-                
-                int maxRate = 0;
-                if(transferRateRequest != null) {
-                    maxRate = transferRateRequest.getMaxUploadRate();
-                }
-                
-                long transSz = connection.transfer(bis, bos, maxRate);
+                long transSz = dataConnection.transferFromClient(os);
                 
                 // log message
                 String userName = session.getUser().getName();
@@ -179,8 +166,7 @@
                 out.send(FtpResponse.REPLY_551_REQUESTED_ACTION_ABORTED_PAGE_TYPE_UNKNOWN, "APPE", fileName);
             }
             finally {
-                IoUtils.close(bis);
-                IoUtils.close(bos);
+                IoUtils.close(os);
             }
             
             // if data transfer ok - send transfer complete message

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/EPSV.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/EPSV.java?view=diff&rev=498135&r1=498134&r2=498135
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/EPSV.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/EPSV.java Sat Jan 20 08:09:22 2007
@@ -21,7 +21,7 @@
 
 import java.io.IOException;
 
-import org.apache.ftpserver.FtpDataConnection;
+import org.apache.ftpserver.FtpDataConnectionFactory;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.ftplet.FtpRequest;
@@ -57,7 +57,7 @@
         session.resetState();
         
         // set data connection
-        FtpDataConnection dataCon = session.getFtpDataConnection();
+        FtpDataConnectionFactory dataCon = session.getFtpDataConnection();
         if (!dataCon.setPasvCommand()) {
             out.send(FtpResponse.REPLY_425_CANT_OPEN_DATA_CONNECTION, "EPSV", null);
             return;   

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/LIST.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/LIST.java?view=diff&rev=498135&r1=498134&r2=498135
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/LIST.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/LIST.java Sat Jan 20 08:09:22 2007
@@ -20,11 +20,9 @@
 package org.apache.ftpserver.command;
 
 import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
 import java.net.SocketException;
 
+import org.apache.ftpserver.FtpDataConnection;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.ftplet.FtpException;
@@ -35,7 +33,6 @@
 import org.apache.ftpserver.listing.LISTFileFormater;
 import org.apache.ftpserver.listing.ListArgument;
 import org.apache.ftpserver.listing.ListArgumentParser;
-import org.apache.ftpserver.util.IoUtils;
 
 /**
  * <code>LIST [&lt;SP&gt; &lt;pathname&gt;] &lt;CRLF&gt;</code><br>
@@ -72,28 +69,25 @@
             
             // get data connection
             out.send(FtpResponse.REPLY_150_FILE_STATUS_OKAY, "LIST", null);
-            OutputStream os = null;
+
+            FtpDataConnection dataConnection;
             try {
-                os = session.getDataOutputStream();
-            }
-            catch(IOException ex) {
-                log.debug("Exception getting the output data stream", ex);
+                dataConnection = session.getFtpDataConnection().openConnection();
+            } catch (Exception e) {
+                log.debug("Exception getting the output data stream", e);
                 out.send(FtpResponse.REPLY_425_CANT_OPEN_DATA_CONNECTION, "LIST", null);
                 return;
             }
             
+            
             // transfer listing data
             boolean failure = false;
-            Writer writer = null;
-            try {
             
-                // open stream
-                writer = new OutputStreamWriter(os, "UTF-8");
-                
+            try {
                 // parse argument
                 ListArgument parsedArg = ListArgumentParser.parse(request.getArgument());
                 
-                writer.write(directoryLister.listFiles(parsedArg, session.getFileSystemView(), LIST_FILE_FORMATER));
+                dataConnection.transferToClient(directoryLister.listFiles(parsedArg, session.getFileSystemView(), LIST_FILE_FORMATER));
             }
             catch(SocketException ex) {
                 log.debug("Socket exception during list transfer", ex);
@@ -108,9 +102,6 @@
                 log.debug("Illegal list syntax: " + request.getArgument(), e);
                 // if listing syntax error - send message
                 out.send(FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "LIST", null);
-            } finally {
-                writer.flush();
-                IoUtils.close(writer);
             }
             
             // if data transfer ok - send transfer complete message

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLSD.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLSD.java?view=diff&rev=498135&r1=498134&r2=498135
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLSD.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/MLSD.java Sat Jan 20 08:09:22 2007
@@ -20,11 +20,9 @@
 package org.apache.ftpserver.command;
 
 import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
 import java.net.SocketException;
 
+import org.apache.ftpserver.FtpDataConnection;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.ftplet.FtpException;
@@ -36,7 +34,6 @@
 import org.apache.ftpserver.listing.ListArgument;
 import org.apache.ftpserver.listing.ListArgumentParser;
 import org.apache.ftpserver.listing.MLSTFileFormater;
-import org.apache.ftpserver.util.IoUtils;
 
 /**
  * <code>MLSD [&lt;SP&gt; &lt;pathname&gt;] &lt;CRLF&gt;</code><br>
@@ -69,29 +66,26 @@
             
             // get data connection
             out.send(FtpResponse.REPLY_150_FILE_STATUS_OKAY, "MLSD", null);
-            OutputStream os = null;
+
+            
+            // print listing data
+            FtpDataConnection dataConnection;
             try {
-                os = session.getDataOutputStream();
-            }
-            catch(IOException ex) {
-                log.debug("Exception getting the output data stream", ex);
+                dataConnection = session.getFtpDataConnection().openConnection();
+            } catch (Exception e) {
+                log.debug("Exception getting the output data stream", e);
                 out.send(FtpResponse.REPLY_425_CANT_OPEN_DATA_CONNECTION, "MLSD", null);
                 return;
             }
             
-            // print listing data
             boolean failure = false;
-            Writer writer = null;
             try {
-                
-                // open stream
-                writer = new OutputStreamWriter(os, "UTF-8");
-                
                 // parse argument
                 ListArgument parsedArg = ListArgumentParser.parse(request.getArgument());
                 
                 FileFormater formater = new MLSTFileFormater((String[])session.getAttribute("MLST.types"));
-                writer.write(directoryLister.listFiles(parsedArg, session.getFileSystemView(), formater));
+                
+                dataConnection.transferToClient(directoryLister.listFiles(parsedArg, session.getFileSystemView(), formater));
             }
             catch(SocketException ex) {
                 log.debug("Socket exception during data transfer", ex);
@@ -106,10 +100,6 @@
                 log.debug("Illegal listing syntax: " + request.getArgument(), e);
                 // if listing syntax error - send message
                 out.send(FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "MLSD", null);
-            }
-            finally {
-                writer.flush();
-                IoUtils.close(writer);
             }
             
             // if data transfer ok - send transfer complete message

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/NLST.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/NLST.java?view=diff&rev=498135&r1=498134&r2=498135
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/NLST.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/NLST.java Sat Jan 20 08:09:22 2007
@@ -20,11 +20,9 @@
 package org.apache.ftpserver.command;
 
 import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
 import java.net.SocketException;
 
+import org.apache.ftpserver.FtpDataConnection;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.ftplet.FtpException;
@@ -37,7 +35,6 @@
 import org.apache.ftpserver.listing.ListArgument;
 import org.apache.ftpserver.listing.ListArgumentParser;
 import org.apache.ftpserver.listing.NLSTFileFormater;
-import org.apache.ftpserver.util.IoUtils;
 
 /**
  * <code>NLST [&lt;SP&gt; &lt;pathname&gt;] &lt;CRLF&gt;</code><br>
@@ -73,24 +70,20 @@
             
             // get data connection
             out.send(FtpResponse.REPLY_150_FILE_STATUS_OKAY, "NLST", null);
-            OutputStream os = null;
+
+            
+            // print listing data
+            FtpDataConnection dataConnection;
             try {
-                os = session.getDataOutputStream();
-            }
-            catch(IOException ex) {
-                log.debug("Exception getting the output data stream", ex);
+                dataConnection = session.getFtpDataConnection().openConnection();
+            } catch (Exception e) {
+                log.debug("Exception getting the output data stream", e);
                 out.send(FtpResponse.REPLY_425_CANT_OPEN_DATA_CONNECTION, "NLST", null);
                 return;
             }
             
-            // print listing data
             boolean failure = false;
-            Writer writer = null;
             try {
-                
-                // open stream
-                writer = new OutputStreamWriter(os, "UTF-8");
-                
                 // parse argument
                 ListArgument parsedArg = ListArgumentParser.parse(request.getArgument());
                 
@@ -101,7 +94,7 @@
                     formater = NLST_FILE_FORMATER;
                 }
                 
-                writer.write(directoryLister.listFiles(parsedArg, session.getFileSystemView(), formater));
+                dataConnection.transferToClient(directoryLister.listFiles(parsedArg, session.getFileSystemView(), formater));
             }
             catch(SocketException ex) {
                 log.debug("Socket exception during data transfer", ex);
@@ -116,9 +109,6 @@
                 log.debug("Illegal listing syntax: " + request.getArgument(), e);
                 // if listing syntax error - send message
                 out.send(FtpResponse.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "LIST", null);
-            } finally {
-                writer.flush();
-                IoUtils.close(writer);
             }
             
             // if data transfer ok - send transfer complete message

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PASV.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PASV.java?view=diff&rev=498135&r1=498134&r2=498135
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PASV.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PASV.java Sat Jan 20 08:09:22 2007
@@ -22,7 +22,7 @@
 import java.io.IOException;
 import java.net.InetAddress;
 
-import org.apache.ftpserver.FtpDataConnection;
+import org.apache.ftpserver.FtpDataConnectionFactory;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.ftplet.FtpException;
@@ -56,7 +56,7 @@
         session.resetState();
         
         // set data connection
-        FtpDataConnection dataCon = session.getFtpDataConnection();
+        FtpDataConnectionFactory dataCon = session.getFtpDataConnection();
         if (!dataCon.setPasvCommand()) {
             out.send(FtpResponse.REPLY_425_CANT_OPEN_DATA_CONNECTION, "PASV", null);
             return;   

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PROT.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PROT.java?view=diff&rev=498135&r1=498134&r2=498135
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PROT.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/PROT.java Sat Jan 20 08:09:22 2007
@@ -21,7 +21,7 @@
 
 import java.io.IOException;
 
-import org.apache.ftpserver.FtpDataConnection;
+import org.apache.ftpserver.FtpDataConnectionFactory;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.ftplet.FtpException;
@@ -58,7 +58,7 @@
         
         // check argument
         arg = arg.toUpperCase();
-        FtpDataConnection dcon = session.getFtpDataConnection();
+        FtpDataConnectionFactory dcon = session.getFtpDataConnection();
         if(arg.equals("C")) {
             dcon.setSecure(false);
             out.send(FtpResponse.REPLY_200_COMMAND_OKAY, "PROT", null);

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RETR.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RETR.java?view=diff&rev=498135&r1=498134&r2=498135
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RETR.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RETR.java Sat Jan 20 08:09:22 2007
@@ -20,13 +20,12 @@
 package org.apache.ftpserver.command;
 
 import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.OutputStream;
 import java.net.SocketException;
 
 import org.apache.commons.logging.Log;
+import org.apache.ftpserver.FtpDataConnection;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.ftplet.DataType;
@@ -39,7 +38,6 @@
 import org.apache.ftpserver.interfaces.FtpServerContext;
 import org.apache.ftpserver.interfaces.ServerFtpStatistics;
 import org.apache.ftpserver.listener.Connection;
-import org.apache.ftpserver.usermanager.TransferRateRequest;
 import org.apache.ftpserver.util.IoUtils;
 
 /**
@@ -128,45 +126,38 @@
             
             // get data connection
             out.send(FtpResponse.REPLY_150_FILE_STATUS_OKAY, "RETR", null);
-            OutputStream os = null;
+
+            
+            // send file data to client
+            boolean failure = false;
+            InputStream is = null;
+
+            FtpDataConnection dataConnection;
             try {
-                os = session.getDataOutputStream();
-            }
-            catch(IOException ex) {
-                log.debug("Exception getting the output data stream", ex);
+                dataConnection = session.getFtpDataConnection().openConnection();
+            } catch (Exception e) {
+                log.debug("Exception getting the output data stream", e);
                 out.send(FtpResponse.REPLY_425_CANT_OPEN_DATA_CONNECTION, "RETR", null);
                 return;
             }
             
-            // send file data to client
-            boolean failure = false;
-            BufferedInputStream bis = null;
-            BufferedOutputStream bos = null;
             try {
                 
                 // open streams
-                bis = IoUtils.getBufferedInputStream(openInputStream(connection, session, file, skipLen) );
-                bos = IoUtils.getBufferedOutputStream(os);
+                is = openInputStream(connection, session, file, skipLen);
                 
                 // transfer data
-                TransferRateRequest transferRateRequest = new TransferRateRequest();
-                transferRateRequest = (TransferRateRequest) session.getUser().authorize(transferRateRequest);
-            
-                int maxRate = 0;
-                if(transferRateRequest != null) {
-                    maxRate = transferRateRequest.getMaxDownloadRate();
-                }
-                
-                long transSz = connection.transfer(bis, bos, maxRate);
+                long transSz = dataConnection.transferToClient(is);
                 
                 // log message
                 String userName = session.getUser().getName();
-                Log log = serverContext.getLogFactory().getInstance(getClass());
                 log.info("File download : " + userName + " - " + fileName);
                 
                 // notify the statistics component
                 ServerFtpStatistics ftpStat = (ServerFtpStatistics)serverContext.getFtpStatistics();
-                ftpStat.setDownload(connection, file, transSz);
+                if(ftpStat != null)  {
+                    ftpStat.setDownload(connection, file, transSz);
+                }
             }
             catch(SocketException ex) {
                 log.debug("Socket exception during data transfer", ex);
@@ -179,8 +170,7 @@
                 out.send(FtpResponse.REPLY_551_REQUESTED_ACTION_ABORTED_PAGE_TYPE_UNKNOWN, "RETR", fileName);
             }
             finally {
-                IoUtils.close(bis);
-                IoUtils.close(bos);
+                IoUtils.close(is);
             }
             
             // if data transfer ok - send transfer complete message

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNFR.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNFR.java?view=diff&rev=498135&r1=498134&r2=498135
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNFR.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/RNFR.java Sat Jan 20 08:09:22 2007
@@ -75,7 +75,7 @@
         else {
             session.setRenameFrom(renFr);
             fileName = renFr.getFullName();
-            out.send(FtpResponse.REPLY_250_REQUESTED_FILE_ACTION_OKAY, "RNFR", fileName);    
+            out.send(FtpResponse.REPLY_350_REQUESTED_FILE_ACTION_PENDING_FURTHER_INFORMATION, "RNFR", fileName);    
         }
     }
     

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOR.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOR.java?view=diff&rev=498135&r1=498134&r2=498135
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOR.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOR.java Sat Jan 20 08:09:22 2007
@@ -19,12 +19,11 @@
 
 package org.apache.ftpserver.command;
 
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
 import java.io.IOException;
-import java.io.InputStream;
+import java.io.OutputStream;
 import java.net.SocketException;
 
+import org.apache.ftpserver.FtpDataConnection;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.ftplet.FileObject;
@@ -36,7 +35,6 @@
 import org.apache.ftpserver.interfaces.FtpServerContext;
 import org.apache.ftpserver.interfaces.ServerFtpStatistics;
 import org.apache.ftpserver.listener.Connection;
-import org.apache.ftpserver.usermanager.TransferRateRequest;
 import org.apache.ftpserver.util.IoUtils;
 
 /**
@@ -116,35 +114,22 @@
             
             // get data connection
             out.send(FtpResponse.REPLY_150_FILE_STATUS_OKAY, "STOR", fileName);
-            InputStream is = null;
+            
+            FtpDataConnection dataConnection;
             try {
-                is = session.getDataInputStream();
-            }
-            catch(IOException ex) {
-                log.debug("Exception getting the input data stream", ex);
+                dataConnection = session.getFtpDataConnection().openConnection();
+            } catch (Exception e) {
+                log.debug("Exception getting the input data stream", e);
                 out.send(FtpResponse.REPLY_425_CANT_OPEN_DATA_CONNECTION, "STOR", fileName);
                 return;
             }
             
-            // get data from client
+            // transfer data
             boolean failure = false;
-            BufferedInputStream bis = null;
-            BufferedOutputStream bos = null;
+            OutputStream outStream = null;
             try {
-            
-                // open streams
-                bis = IoUtils.getBufferedInputStream(is);
-                bos = IoUtils.getBufferedOutputStream( file.createOutputStream(skipLen) );
-                
-                // transfer data
-                TransferRateRequest transferRateRequest = new TransferRateRequest();
-                transferRateRequest = (TransferRateRequest) session.getUser().authorize(transferRateRequest);
-                
-                int maxRate = 0;
-                if(transferRateRequest != null) {
-                    maxRate = transferRateRequest.getMaxUploadRate();
-                }
-                long transSz = connection.transfer(bis, bos, maxRate);
+                outStream = file.createOutputStream(skipLen);
+                long transSz = dataConnection.transferFromClient(outStream);
                 
                 // log message
                 String userName = session.getUser().getName();
@@ -165,8 +150,7 @@
                 out.send(FtpResponse.REPLY_551_REQUESTED_ACTION_ABORTED_PAGE_TYPE_UNKNOWN, "STOR", fileName);
             }
             finally {
-                IoUtils.close(bis);
-                IoUtils.close(bos);
+                IoUtils.close(outStream);
             }
             
             // if data transfer ok - send transfer complete message

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOU.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOU.java?view=diff&rev=498135&r1=498134&r2=498135
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOU.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/command/STOU.java Sat Jan 20 08:09:22 2007
@@ -19,12 +19,11 @@
 
 package org.apache.ftpserver.command;
 
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
 import java.io.IOException;
-import java.io.InputStream;
+import java.io.OutputStream;
 import java.net.SocketException;
 
+import org.apache.ftpserver.FtpDataConnection;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
 import org.apache.ftpserver.ftplet.FileObject;
@@ -38,7 +37,6 @@
 import org.apache.ftpserver.interfaces.FtpServerContext;
 import org.apache.ftpserver.interfaces.ServerFtpStatistics;
 import org.apache.ftpserver.listener.Connection;
-import org.apache.ftpserver.usermanager.TransferRateRequest;
 import org.apache.ftpserver.util.IoUtils;
 
 /**
@@ -120,36 +118,28 @@
             
             // get data connection
             out.send(FtpResponse.REPLY_150_FILE_STATUS_OKAY, "STOU", null);
-            InputStream is = null;
+            
+            // get data from client
+            boolean failure = false;
+            OutputStream os = null;
+            out.send(FtpResponse.REPLY_250_REQUESTED_FILE_ACTION_OKAY, "STOU", fileName);
+            
+            FtpDataConnection dataConnection;
             try {
-                is = session.getDataInputStream();
-            }
-            catch(IOException ex) {
-                log.debug("Exception getting the input data stream", ex);
+                dataConnection = session.getFtpDataConnection().openConnection();
+            } catch (Exception e) {
+                log.debug("Exception getting the input data stream", e);
                 out.send(FtpResponse.REPLY_425_CANT_OPEN_DATA_CONNECTION, "STOU", fileName);
                 return;
             }
             
-            // get data from client
-            boolean failure = false;
-            BufferedInputStream bis = null;
-            BufferedOutputStream bos = null;
-            out.send(FtpResponse.REPLY_250_REQUESTED_FILE_ACTION_OKAY, "STOU", fileName);
             try {
                 
                 // open streams
-                bis = IoUtils.getBufferedInputStream(is);
-                bos = IoUtils.getBufferedOutputStream( file.createOutputStream(0L) );
+                os = file.createOutputStream(0L);
 
                 // transfer data
-                TransferRateRequest transferRateRequest = new TransferRateRequest();
-                transferRateRequest = (TransferRateRequest) session.getUser().authorize(transferRateRequest);
-                
-                int maxRate = 0;
-                if(transferRateRequest != null) {
-                    maxRate = transferRateRequest.getMaxUploadRate();
-                }
-                long transSz = connection.transfer(bis, bos, maxRate);
+                long transSz = dataConnection.transferFromClient(os);
                 
                 // log message
                 String userName = session.getUser().getName();
@@ -172,8 +162,7 @@
                 out.send(FtpResponse.REPLY_551_REQUESTED_ACTION_ABORTED_PAGE_TYPE_UNKNOWN, "STOU", fileName);
             }
             finally {
-                IoUtils.close(bis);
-                IoUtils.close(bos);
+                IoUtils.close(os);
             }
             
             // if data transfer ok - send transfer complete message

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/AbstractConnection.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/AbstractConnection.java?view=diff&rev=498135&r1=498134&r2=498135
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/AbstractConnection.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/AbstractConnection.java Sat Jan 20 08:09:22 2007
@@ -19,18 +19,12 @@
 
 package org.apache.ftpserver.listener;
 
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
 import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
 
 import org.apache.commons.logging.Log;
 import org.apache.ftpserver.FtpSessionImpl;
-import org.apache.ftpserver.ftplet.DataType;
 import org.apache.ftpserver.ftplet.FtpSession;
 import org.apache.ftpserver.interfaces.FtpServerContext;
-import org.apache.ftpserver.util.IoUtils;
 
 
 /**
@@ -94,67 +88,5 @@
     protected void notifyObserver() {
         ftpSession.updateLastAccessTime();
         serverContext.getConnectionManager().updateConnection(this);
-    }
-
-
-    /**
-     * Transfer data.
-     */
-    public final long transfer(InputStream in, OutputStream out, int maxRate) throws IOException {
-        
-        BufferedInputStream bis = IoUtils.getBufferedInputStream(in);
-        BufferedOutputStream bos = IoUtils.getBufferedOutputStream( out );
-        
-        boolean isAscii = ftpSession.getDataType() == DataType.ASCII;
-        long startTime = System.currentTimeMillis();
-        long transferredSize = 0L;
-        byte[] buff = new byte[4096];
-        
-        while(true) {
-            
-            // if current rate exceeds the max rate, sleep for 50ms 
-            // and again check the current transfer rate
-            if(maxRate > 0) {
-                
-                // prevent "divide by zero" exception
-                long interval = System.currentTimeMillis() - startTime;
-                if(interval == 0) {
-                    interval = 1;
-                }
-                
-                // check current rate
-                long currRate = (transferredSize*1000L)/interval;
-                if(currRate > maxRate) {
-                    try { Thread.sleep(50); } catch(InterruptedException ex) {break;}
-                    continue;
-                }
-            }
-            
-            // read data
-            int count = bis.read(buff);
-            if(count == -1) {
-                break;
-            }
-            
-            // write data
-            // if ascii, replace \n by \r\n
-            if(isAscii) {
-                for(int i=0; i<count; ++i) {
-                    byte b = buff[i];
-                    if(b == '\n') {
-                        bos.write('\r');
-                    }
-                    bos.write(b);
-                }
-            }
-            else {
-                bos.write(buff, 0, count);
-            }
-            
-            transferredSize += count;
-            notifyObserver();
-        }
-        
-        return transferredSize;
     }
 }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/Connection.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/Connection.java?view=diff&rev=498135&r1=498134&r2=498135
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/Connection.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/Connection.java Sat Jan 20 08:09:22 2007
@@ -19,10 +19,6 @@
 
 package org.apache.ftpserver.listener;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
 import org.apache.ftpserver.ftplet.FtpSession;
 import org.apache.ftpserver.interfaces.FtpServerContext;
 
@@ -63,7 +59,5 @@
     void beforeSecureControlChannel(String type) throws Exception;
 
     void afterSecureControlChannel(String type) throws Exception;
-
-    long transfer(InputStream bis, OutputStream bos, int maxRate) throws IOException;
 }
  

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/ConnectionManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/ConnectionManagerImpl.java?view=diff&rev=498135&r1=498134&r2=498135
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/ConnectionManagerImpl.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/ConnectionManagerImpl.java Sat Jan 20 08:09:22 2007
@@ -28,7 +28,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.ftpserver.FtpDataConnection;
+import org.apache.ftpserver.FtpDataConnectionFactory;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.ftplet.Configuration;
 import org.apache.ftpserver.ftplet.FtpException;
@@ -260,7 +260,7 @@
                 }
                 
                 // idle data connection
-                FtpDataConnection dataCon = session.getFtpDataConnection();
+                FtpDataConnectionFactory dataCon = session.getFtpDataConnection();
                 if(dataCon == null) {
                     continue;
                 }

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOConnection.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOConnection.java?view=diff&rev=498135&r1=498134&r2=498135
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOConnection.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/io/IOConnection.java Sat Jan 20 08:09:22 2007
@@ -29,7 +29,7 @@
 import javax.net.ssl.SSLPeerUnverifiedException;
 import javax.net.ssl.SSLSocket;
 
-import org.apache.ftpserver.FtpDataConnection;
+import org.apache.ftpserver.FtpDataConnectionFactory;
 import org.apache.ftpserver.FtpRequestImpl;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.FtpWriter;
@@ -70,15 +70,16 @@
         protocolHandler = new FtpProtocolHandler(serverContext);
         
         // data connection object
-        FtpDataConnection dataCon = new FtpDataConnection();
-        dataCon.setServerContext(this.serverContext);
-        dataCon.setServerControlAddress(controlSocket.getLocalAddress());
         
         // reader object
         ftpSession = new FtpSessionImpl();
         ftpSession.setClientAddress(this.controlSocket.getInetAddress());
-        ftpSession.setFtpDataConnection(dataCon);
+
+        FtpDataConnectionFactory dataCon = new FtpDataConnectionFactory(this.serverContext, ftpSession);
+        dataCon.setServerControlAddress(controlSocket.getLocalAddress());
         
+        ftpSession.setFtpDataConnection(dataCon);
+
         if(this.controlSocket instanceof SSLSocket) {
             SSLSocket sslControlSocket = (SSLSocket) this.controlSocket;
             

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/mina/MinaConnection.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/mina/MinaConnection.java?view=diff&rev=498135&r1=498134&r2=498135
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/mina/MinaConnection.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/listener/mina/MinaConnection.java Sat Jan 20 08:09:22 2007
@@ -25,7 +25,7 @@
 import javax.net.ssl.SSLPeerUnverifiedException;
 import javax.net.ssl.SSLSession;
 
-import org.apache.ftpserver.FtpDataConnection;
+import org.apache.ftpserver.FtpDataConnectionFactory;
 import org.apache.ftpserver.FtpSessionImpl;
 import org.apache.ftpserver.ftplet.FtpException;
 import org.apache.ftpserver.interfaces.FtpServerContext;
@@ -45,13 +45,14 @@
         this.session = session;
         
         // data connection object
-        FtpDataConnection dataCon = new FtpDataConnection();
-        dataCon.setServerContext(this.serverContext);
-        dataCon.setServerControlAddress(((InetSocketAddress)session.getLocalAddress()).getAddress());
         
         // reader object
         ftpSession = new FtpSessionImpl();
         ftpSession.setClientAddress(((InetSocketAddress)session.getRemoteAddress()).getAddress());
+
+        FtpDataConnectionFactory dataCon = new FtpDataConnectionFactory(this.serverContext, ftpSession);
+        dataCon.setServerControlAddress(((InetSocketAddress)session.getLocalAddress()).getAddress());
+        
         ftpSession.setFtpDataConnection(dataCon);
         
         if(session.getFilterChain().contains("sslFilter")) {

Modified: incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/clienttests/StoreTest.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/clienttests/StoreTest.java?view=diff&rev=498135&r1=498134&r2=498135
==============================================================================
--- incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/clienttests/StoreTest.java (original)
+++ incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/clienttests/StoreTest.java Sat Jan 20 08:09:22 2007
@@ -110,7 +110,8 @@
 
     public void testStoreWithDirectoryInPlace() throws Exception {
         File testFile = new File(ROOT_DIR, TEST_FILENAME);
-        testFile.mkdirs();
+        assertFalse(testFile.exists());
+        assertTrue(testFile.mkdirs());
         
         assertTrue(testFile.exists());
         assertFalse(client.storeFile(TEST_FILENAME, new ByteArrayInputStream(testData)));

Modified: incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/FtpSession.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/FtpSession.java?view=diff&rev=498135&r1=498134&r2=498135
==============================================================================
--- incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/FtpSession.java (original)
+++ incubator/ftpserver/trunk/ftplet-api/src/java/org/apache/ftpserver/ftplet/FtpSession.java Sat Jan 20 08:09:22 2007
@@ -19,9 +19,6 @@
 
 package org.apache.ftpserver.ftplet;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
 import java.net.InetAddress;
 import java.security.cert.Certificate;
 import java.util.Date;
@@ -126,16 +123,6 @@
      * Get structure.
      */
     Structure getStructure();
-    
-    /**
-     * Get data input stream.
-     */
-    InputStream getDataInputStream() throws IOException;
-    
-    /**
-     * Get data output stream.
-     */
-    OutputStream getDataOutputStream() throws IOException;
     
     /**
      * Returns the value of the named attribute as an Object, 



Mime
View raw message