Search in sources :

Example 1 with FtpClient

use of com.acgist.snail.net.ftp.FtpClient in project snail by acgist.

the class FtpProtocol method buildSize.

@Override
protected void buildSize() throws DownloadException {
    final FtpClient client = FtpClient.newInstance(this.url);
    try {
        client.connect();
        final long size = client.size();
        this.taskEntity.setSize(size);
    } catch (NetException e) {
        throw new DownloadException(e);
    } finally {
        client.close();
    }
}
Also used : NetException(com.acgist.snail.context.exception.NetException) DownloadException(com.acgist.snail.context.exception.DownloadException) FtpClient(com.acgist.snail.net.ftp.FtpClient)

Aggregations

DownloadException (com.acgist.snail.context.exception.DownloadException)1 NetException (com.acgist.snail.context.exception.NetException)1 FtpClient (com.acgist.snail.net.ftp.FtpClient)1