List of usage examples for org.apache.commons.net.ftp FTPCmd APPE
FTPCmd APPE
To view the source code for org.apache.commons.net.ftp FTPCmd APPE.
Click Source Link
From source file:com.adaptris.ftp.ApacheFtpClientImpl.java
@Override public void put(InputStream srcStream, String remoteFile, boolean append) throws IOException { try {/*from w ww .j ava 2 s . c om*/ acquireLock(); if (append) { log("{} {}", FTPCmd.APPE, remoteFile); handleReturnValue(ftpClient().appendFile(remoteFile, srcStream)); } else { log("{} {}", FTPCmd.STOR, remoteFile); handleReturnValue(ftpClient().storeFile(remoteFile, srcStream)); } } finally { logReply(ftpClient().getReplyStrings()); releaseLock(); } }
From source file:ch.cyberduck.core.ftp.FTPClient.java
@Override public boolean appendFile(String remote, InputStream local) throws IOException { this.pret(FTPCmd.APPE, remote); return super.appendFile(remote, local); }
From source file:ch.cyberduck.core.ftp.FTPClient.java
@Override public OutputStream appendFileStream(String remote) throws IOException { this.pret(FTPCmd.APPE, remote); return super.appendFileStream(remote); }
From source file:com.atomicleopard.thundr.ftp.commons.FTP.java
/*** * A convenience method to send the FTP APPE command to the server, * receive the reply, and return the reply code. Remember, it is up * to you to manage the data connection. If you don't need this low * level of access, use {@link org.apache.commons.net.ftp.FTPClient} * , which will handle all low level details for you. * <p>//from w w w . java 2 s. co m * @param pathname The pathname to use for the file when stored at * the remote end of the transfer. * @return The reply code received from the server. * @exception 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. * @exception IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int appe(String pathname) throws IOException { return sendCommand(FTPCmd.APPE, pathname); }
From source file:com.atomicleopard.thundr.ftp.commons.FTPClient.java
/** * Appends to a file on the server with the given name, taking input * from the given InputStream. This method does NOT close the given * InputStream. If the current file type is ASCII, line separators in * the file are transparently converted to the NETASCII format (i.e., * you should not attempt to create a special InputStream to do this). * <p>/*from w w w .j a v a 2s . c o m*/ * @param remote The name of the remote file. * @param local The local InputStream from which to read the data to * be appended to the remote file. * @return True if successfully completed, false if not. * @exception 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. * @exception org.apache.commons.net.io.CopyStreamException * If an I/O error occurs while actually * transferring the file. The CopyStreamException allows you to * determine the number of bytes transferred and the IOException * causing the error. This exception may be caught either * as an IOException or independently as itself. * @exception IOException If an I/O error occurs while either sending a * command to the server or receiving a reply from the server. */ public boolean appendFile(String remote, InputStream local) throws IOException { return __storeFile(FTPCmd.APPE, remote, local); }
From source file:com.atomicleopard.thundr.ftp.commons.FTPClient.java
/** * Returns an OutputStream through which data can be written to append * to a file on the server with the given name. If the current file type * is ASCII, the returned OutputStream will convert line separators in * the file to the NETASCII format (i.e., you should not attempt to * create a special OutputStream to do this). You must close the * OutputStream when you finish writing to it. The OutputStream itself * will take care of closing the parent data connection socket upon being * closed. To finalize the file transfer you must call * {@link #completePendingCommand completePendingCommand } and * check its return value to verify success. * <p>//from w w w. j a v a 2 s .c o m * @param remote The name of the remote file. * @return An OutputStream through which the remote file can be appended. * If the data connection cannot be opened (e.g., the file does not * exist), null is returned (in which case you may check the reply * code to determine the exact reason for failure). * @exception 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. * @exception IOException If an I/O error occurs while either sending a * command to the server or receiving a reply from the server. */ public OutputStream appendFileStream(String remote) throws IOException { return __storeFileStream(FTPCmd.APPE, remote); }