2
* JHylaFax - A java client for HylaFAX.
4
* Copyright (C) 2005 by Steffen Pingel <steffenp@gmx.de>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
package net.sf.jhylafax;
22
import gnu.inet.ftp.TransferListener;
23
import org.xnap.commons.io.ProgressMonitor;
24
import org.xnap.commons.io.SubTaskProgressMonitor;
27
* A mediator that links a {@link gnu.inet.ftp.TransferListener} and
28
* a {@link org.xnap.commons.io.ProgressMonitor} object.
30
* @author Steffen Pingel
32
public class TransferMonitor implements TransferListener {
34
private SubTaskProgressMonitor monitor;
36
public TransferMonitor(ProgressMonitor monitor, int amount, long totalSize) {
37
this.monitor = new SubTaskProgressMonitor(monitor, amount, totalSize);
40
public void transferStarted()
44
public void transferCompleted()
49
public void transfered(long value)
51
monitor.setValue(value);
54
public void transferFailed()