Example usage for org.apache.commons.net.ftp FTPSClient deleteFile

List of usage examples for org.apache.commons.net.ftp FTPSClient deleteFile

Introduction

In this page you can find the example usage for org.apache.commons.net.ftp FTPSClient deleteFile.

Prototype

public boolean deleteFile(String pathname) throws IOException 

Source Link

Document

Deletes a file on the FTP server.

Usage

From source file:org.mule.transport.ftps.FtpsMessageReceiver.java

protected void postProcess(FTPSClient client, FTPFile file, MuleMessage message) throws Exception {
    if (!client.deleteFile(file.getName())) {
        throw new IOException(MessageFormat.format("Failed to delete file {0}. Ftp error: {1}", file.getName(),
                client.getReplyCode()));
    }/*from  w  w  w . j  a  v a  2  s .co m*/
    if (logger.isDebugEnabled()) {
        logger.debug("Deleted processed file " + file.getName());
    }

    if (connector.isStreaming()) {
        if (!client.completePendingCommand()) {
            throw new IOException(MessageFormat.format(
                    "Failed to complete a pending command. Retrieveing file {0}. Ftp error: {1}",
                    file.getName(), client.getReplyCode()));
        }
    }
}

From source file:org.mule.transport.ftps.FtpsMessageRequester.java

protected void postProcess(FTPSClient client, FTPFile file, MuleMessage message) throws Exception {
    if (!connector.isStreaming()) {
        if (!client.deleteFile(file.getName())) {
            throw new IOException(MessageFormat.format("Failed to delete file {0}. Ftp error: {1}",
                    file.getName(), client.getReplyCode()));
        }/*  w  ww .j a v a2s . c o  m*/
        if (logger.isDebugEnabled()) {
            logger.debug("Deleted file " + file.getName());
        }
    }
}