/** * @param file name of file * @return the status * @throws IOException on error * @since 2.0 **/ public int mdtm(String file) throws IOException { return sendCommand(FTPCmd.MDTM, file); }
/** * A convenience method to send the FTP FEAT command to the server, receive the reply, * and return the reply code. * @return The reply code received by the server * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. * @since 2.2 */ public int feat() throws IOException { return sendCommand(FTPCmd.FEAT); }
/** * A convenience method to send the FTP PASS command to the server, * receive the reply, and return the reply code. * @param password The plain text password of the username being logged into. * @return The reply code received from the server. * @throws FTPConnectionClosedException * If the FTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send FTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. */ public int pass(String password) throws IOException { return sendCommand(FTPCmd.PASS, password); }
/*** * A convenience method to send the FTP ABOR command to the server, * receive the reply, and return the reply code. * * @return The reply code received from the server. * @throws FTPConnectionClosedException * If the FTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send FTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int abor() throws IOException { return sendCommand(FTPCmd.ABOR); }
/*** * A convenience method to send the FTP CDUP command to the server, * receive the reply, and return the reply code. * * @return The reply code received from the server. * @throws FTPConnectionClosedException * If the FTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send FTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int cdup() throws IOException { return sendCommand(FTPCmd.CDUP); }
/*** * A convenience method to send the FTP STAT command to the server, * receive the reply, and return the reply code. * * @return The reply code received from the server. * @throws FTPConnectionClosedException * If the FTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send FTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int stat() throws IOException { return sendCommand(FTPCmd.STAT); }
/*** * A convenience method to send the FTP HELP command to the server, * receive the reply, and return the reply code. * * @return The reply code received from the server. * @throws FTPConnectionClosedException * If the FTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send FTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int help() throws IOException { return sendCommand(FTPCmd.HELP); }
/*** * A convenience method to send the FTP NOOP command to the server, * receive the reply, and return the reply code. * * @return The reply code received from the server. * @throws FTPConnectionClosedException * If the FTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send FTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int noop() throws IOException { return sendCommand(FTPCmd.NOOP); }
/*** * A convenience method to send the FTP STAT command to the server, * receive the reply, and return the reply code. * * @param pathname A pathname to list. * @return The reply code received from the server. * @throws FTPConnectionClosedException * If the FTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send FTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int stat(String pathname) throws IOException { return sendCommand(FTPCmd.STAT, pathname); }
/*** * A convenience method to send the FTP HELP command to the server, * receive the reply, and return the reply code. * * @param command The command name on which to request help. * @return The reply code received from the server. * @throws FTPConnectionClosedException * If the FTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send FTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int help(String command) throws IOException { return sendCommand(FTPCmd.HELP, command); }
/*** * A convenience method to send the FTP PWD command to the server, * receive the reply, and return the reply code. * * @return The reply code received from the server. * @throws FTPConnectionClosedException * If the FTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send FTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int pwd() throws IOException { return sendCommand(FTPCmd.PWD); }
/*** * A convenience method to send the FTP SYST command to the server, * receive the reply, and return the reply code. * * @return The reply code received from the server. * @throws FTPConnectionClosedException * If the FTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send FTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int syst() throws IOException { return sendCommand(FTPCmd.SYST); }
/*** * A convenience method to send the FTP SMNT command to the server, * receive the reply, and return the reply code. * * @param dir The directory name. * @return The reply code received from the server. * @throws FTPConnectionClosedException * If the FTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send FTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int smnt(String dir) throws IOException { return sendCommand(FTPCmd.SMNT, dir); }
/*** * A convenience method to send the FTP SITE command to the server, * receive the reply, and return the reply code. * * @param parameters The site parameters to send. * @return The reply code received from the server. * @throws FTPConnectionClosedException * If the FTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send FTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int site(String parameters) throws IOException { return sendCommand(FTPCmd.SITE, parameters); }
/*** * A convenience method to send the FTP USER command to the server, * receive the reply, and return the reply code. * * @param username The username to login under. * @return The reply code received from the server. * @throws FTPConnectionClosedException * If the FTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send FTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int user(String username) throws IOException { return sendCommand(FTPCmd.USER, username); }
/*** * A convenience method to send the FTP REST command to the server, * receive the reply, and return the reply code. * * @param marker The marker at which to restart a transfer. * @return The reply code received from the server. * @throws FTPConnectionClosedException * If the FTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send FTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int rest(String marker) throws IOException { return sendCommand(FTPCmd.REST, marker); }
/*** * A convenience method to send the FTP QUIT command to the server, * receive the reply, and return the reply code. * * @return The reply code received from the server. * @throws FTPConnectionClosedException * If the FTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send FTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int quit() throws IOException { return sendCommand(FTPCmd.QUIT); }
/*** * A convenience method to send the FTP REIN command to the server, * receive the reply, and return the reply code. * * @return The reply code received from the server. * @throws FTPConnectionClosedException * If the FTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send FTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int rein() throws IOException { return sendCommand(FTPCmd.REIN); }
/*** * A convenience method to send the FTP EPSV command to the server, * receive the reply, and return the reply code. Remember, it's up * to you to interpret the reply string containing the host/port * information. * * @return The reply code received from the server. * @throws FTPConnectionClosedException * If the FTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send FTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. * @since 2.2 ***/ public int epsv() throws IOException { return sendCommand(FTPCmd.EPSV); }
/*** * A convenience method to send the FTP ALLO command to the server, * receive the reply, and return the reply code. * * @param bytes The number of bytes to allocate. * @return The reply code received from the server. * @throws FTPConnectionClosedException * If the FTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send FTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int allo(int bytes) throws IOException { return sendCommand(FTPCmd.ALLO, Integer.toString(bytes)); }