Logo Search packages:      
Sourcecode: jftp version File versions  Download package

int net::sf::jftp::net::FtpConnection::handleDownload ( String  file  )  [inline]

Download a file or directory. Uses multithreading if enabled and does not block.

Parameters:
file The file to download
Returns:
An int-statuscode, see constants defined in this class for details

Implements net::sf::jftp::net::BasicConnection.

Definition at line 1168 of file FtpConnection.java.

References download(), getCachedPWD(), getLocalPath(), host, net::sf::jftp::net::FtpConstants::NEW_TRANSFER_SPAWNED, password, port, and username.

    {
        if(Settings.getEnableMultiThreading())
        {
            Log.out("spawning new thread for this download.");

            FtpTransfer t = new FtpTransfer(host, port, getLocalPath(),
                                            getCachedPWD(), file, username,
                                            password, Transfer.DOWNLOAD,
                                            handler, listeners, crlf);
            lastTransfer = t;

            return NEW_TRANSFER_SPAWNED;
        }
        else
        {
            Log.out("multithreading is completely disabled.");

            return download(file);
        }
    }


Generated by  Doxygen 1.6.0   Back to index