Example usage for org.apache.commons.net.ftp FTP LOCAL_FILE_TYPE

List of usage examples for org.apache.commons.net.ftp FTP LOCAL_FILE_TYPE

Introduction

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

Prototype

int LOCAL_FILE_TYPE

To view the source code for org.apache.commons.net.ftp FTP LOCAL_FILE_TYPE.

Click Source Link

Document

A constant used to indicate the file(s) being transfered should be treated as a local type.

Usage

From source file:org.wso2.carbon.connector.FileFtpOverProxyConnector.java

/**
 * Set the file type to be transferred.//from  w  ww  . ja  v  a  2  s .co m
 *
 * @param fileType The type of the file.
 * @param ftp The FTPClient which is used to transfer the file.
 * @throws IOException If an I/O error occurs while either sending a command to the server or receiving a reply
 * from the server.
 */
private void setFileType(String fileType, FTPClient ftp) throws IOException {
    switch (fileType) {
    case "BINARY":
        ftp.setFileType(FTP.BINARY_FILE_TYPE);
        break;
    case "ASCII":
        ftp.setFileType(FTP.ASCII_FILE_TYPE);
        break;
    case "EBCDIC":
        ftp.setFileType(FTP.EBCDIC_FILE_TYPE);
        break;
    case "LOCAL":
        ftp.setFileType(FTP.LOCAL_FILE_TYPE);
        break;
    default:
        ftp.setFileType(FTP.ASCII_FILE_TYPE);
    }
}