Java Code Examples for org.apache.commons.net.ftp.FTP#NON_PRINT_TEXT_FORMAT

The following examples show how to use org.apache.commons.net.ftp.FTP#NON_PRINT_TEXT_FORMAT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Client.java    From anthelion with Apache License 2.0 5 votes vote down vote up
private void __initDefaults()
{
    __passiveHost        = null;
    __passivePort        = -1;
    __fileType           = FTP.ASCII_FILE_TYPE;
    __fileFormat         = FTP.NON_PRINT_TEXT_FORMAT;
    __systemName         = null;
    __entryParser        = null;
}
 
Example 2
Source File: Client.java    From anthelion with Apache License 2.0 3 votes vote down vote up
/***
 * Sets the file type to be transferred.  This should be one of 
 * <code> FTP.ASCII_FILE_TYPE </code>, <code> FTP.IMAGE_FILE_TYPE </code>,
 * etc.  The file type only needs to be set when you want to change the
 * type.  After changing it, the new type stays in effect until you change
 * it again.  The default file type is <code> FTP.ASCII_FILE_TYPE </code>
 * if this method is never called.
 * <p>
 * @param fileType The <code> _FILE_TYPE </code> constant indcating the
 *                 type of 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 IOException  If an I/O error occurs while either sending a
 *      command to the server or receiving a reply from the server.
 ***/
public boolean setFileType(int fileType) throws IOException
{
    if (FTPReply.isPositiveCompletion(type(fileType)))
    {
        __fileType = fileType;
        __fileFormat = FTP.NON_PRINT_TEXT_FORMAT;
        return true;
    }
    return false;
}