3 import java.io.IOException;
5 import de.j32.jpim.conduit.Conduit;
6 import de.j32.jpim.conduit.ConduitException;
7 import de.j32.jpim.conduit.Exporter;
8 import de.j32.jpim.conduit.Importer;
9 import de.j32.jpim.data.EntryConsumer;
10 import de.j32.jpim.data.EntryProducer;
11 import de.j32.util.Util;
15 public static void transfer(EntryProducer producer, EntryConsumer consumer)
17 // TODO: It would be more 'beautiful' to have the EntryProducer be an
18 // Iterable, but this is simpler ...
19 producer.sendTo(consumer);
22 public static void transfer(Conduit conduit, EntryConsumer consumer) throws ConduitException,
25 Importer importer = null;
27 importer = conduit.importer();
28 transfer(importer, consumer);
33 Util.nothrowClose(importer);
37 public static void transfer(EntryProducer producer, Conduit conduit) throws ConduitException,
40 Exporter exporter = null;
42 exporter = conduit.exporter();
43 transfer(producer, exporter);
48 Util.nothrowClose(exporter);