Index: FTPClient.java =================================================================== RCS file: /home/cvspublic/jakarta-commons/net/src/java/org/apache/commons/net/ftp/FTPClient.java,v retrieving revision 1.38 diff -u -r1.38 FTPClient.java --- FTPClient.java 29 Jun 2004 04:54:30 -0000 1.38 +++ FTPClient.java 31 Aug 2004 18:42:08 -0000 @@ -352,7 +352,15 @@ __passivePort = index; } - private boolean __storeFile(int command, String remote, InputStream local) + + protected boolean __storeFile(int command, String remote, InputStream local) + throws IOException + { + return __storeFile( FTPCommand.getCommand(command), remote, local); + } + + + protected boolean __storeFile(String command, String remote, InputStream local) throws IOException { OutputStream output; @@ -433,6 +441,31 @@ * command to the server or receiving a reply from the server. */ protected Socket _openDataConnection_(int command, String arg) + throws IOException + { + return _openDataConnection_( FTPCommand.getCommand( command ), arg); + } + + + /** + * Establishes a data connection with the FTP server, returning + * a Socket for the connection if successful. If a restart + * offset has been set with {@link #setRestartOffset(long)}, + * a REST command is issued to the server with the offset as + * an argument before establishing the data connection. Active + * mode connections also cause a local PORT command to be issued. + *

+ * @param command The text representation of the FTP command to send. + * @param arg The arguments to the FTP command. If this parameter is + * set to null, then the command is sent with no argument. + * @return A Socket corresponding to the established data connection. + * Null is returned if an FTP protocol error is reported at + * any point during the establishment and initialization of + * the connection. + * @exception IOException If an I/O error occurs while either sending a + * command to the server or receiving a reply from the server. + */ + protected Socket _openDataConnection_(String command, String arg) throws IOException { Socket socket;