001 /* 002 * ftp4j - A pure Java FTP client library 003 * 004 * Copyright (C) 2008-2009 Carlo Pelliccia (www.sauronsoftware.it) 005 * 006 * This program is free software: you can redistribute it and/or modify 007 * it under the terms of the GNU Lesser General Public License version 008 * 2.1, as published by the Free Software Foundation. 009 * 010 * This program is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 013 * GNU General Public License for more details. 014 * 015 * You should have received a copy of the GNU Lesser General Public 016 * License version 2.1 along with this program. 017 * If not, see <http://www.gnu.org/licenses/>. 018 */ 019 package it.sauronsoftware.ftp4j; 020 021 /** 022 * This interface describes the methods requested by an object that can listen 023 * data transfer operations. You can supply an object implementing this 024 * interface to any upload/download method of the client. 025 * 026 * @author Carlo Pelliccia 027 */ 028 public interface FTPDataTransferListener { 029 030 /** 031 * Called to notify the listener that the transfer operation has been 032 * initialized. 033 */ 034 public void started(); 035 036 /** 037 * Called to notify the listener that some bytes have been transmitted. 038 * 039 * @param length 040 * The number of the bytes transmitted since the last time the 041 * method was called (or since the begin of the operation, at the 042 * first call received). 043 */ 044 public void transferred(int length); 045 046 /** 047 * Called to notify the listener that the transfer operation has been 048 * successfully complete. 049 */ 050 public void completed(); 051 052 /** 053 * Called to notify the listener that the transfer operation has been 054 * aborted. 055 */ 056 public void aborted(); 057 058 /** 059 * Called to notify the listener that the transfer operation has failed due 060 * to an error. 061 */ 062 public void failed(); 063 064 }