001    /*
002     * ftp4j - A pure Java FTP client library
003     * 
004     * Copyright (C) 2008 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 General Public License as published by
008     * the Free Software Foundation, either version 3 of the License, or
009     * (at your option) any later version.
010     *
011     * This program is distributed in the hope that it will be useful,
012     * but WITHOUT ANY WARRANTY; without even the implied warranty of
013     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014     * GNU General Public License for more details.
015     *
016     * You should have received a copy of the GNU General Public License
017     * along with this program.  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    }