Package org.apache.commons.net.ftp

Examples of org.apache.commons.net.ftp.FTPClient.deleteFile()


        }
        FTPClient client = null;
        try {
            client = (FTPClient) borrowClient();
            processFile(client, file);
            if (!client.deleteFile(getWorkingPath() + file.getName())) {
                throw new IOException("Could not delete file " + file);
            }
        }
        catch (Exception e) {
            log.error("Failed to process file: " + file + ". Reason: " + e, e);
View Full Code Here


     * @throws PageException
     */
    private FTPClient actionRemove() throws IOException, PageException {
        required("item",item);
        FTPClient client = getClient();
        client.deleteFile(item);
        writeCfftp(client);
       
        return client;
    }

View Full Code Here

                processFile(ftp, file);
                // Processing is successful
                // We should not unlock until the file has been deleted
                unlock = false;
                if (isDeleteFile()) {
                    if (!ftp.deleteFile(file)) {
                        throw new IOException("Could not delete file " + file);
                    }
                    unlock = true;
                }
            } else {
View Full Code Here

            else {
                out = client.storeFileStream(name);
                if (out == null) {
                    // lets try overwrite the previous file?
                    if (overwrite) {
                        client.deleteFile(name);
                    }
                    out = client.storeFileStream(name);
                }
            }
            if (out == null) {
View Full Code Here

        url = message.getURL();
        final FTPClient ftp = createFTP();

        String path = url.getPath();
        try {
            if (!ftp.deleteFile(path)) {
                throw new JMSException("Delete file failed: " + ftp.getReplyString());
            }
        } finally {
            ftp.quit();
            ftp.disconnect();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.