diff --git a/apps/i2psnark/java/src/org/klomp/snark/CompleteListener.java b/apps/i2psnark/java/src/org/klomp/snark/CompleteListener.java new file mode 100644 index 0000000000000000000000000000000000000000..5e2388aeb5539e2e71c7af36e4953fbc81571d84 --- /dev/null +++ b/apps/i2psnark/java/src/org/klomp/snark/CompleteListener.java @@ -0,0 +1,55 @@ +/* CompleteListener - Callback for Snark events + + Copyright (C) 2003 Mark J. Wielaard + + This file is part of Snark. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +package org.klomp.snark; + +/** + * Callback for Snark events. + * @since 0.9.4 moved from Snark.java + */ +public interface CompleteListener { + public void torrentComplete(Snark snark); + public void updateStatus(Snark snark); + + /** + * We transitioned from magnet mode, we have now initialized our + * metainfo and storage. The listener should now call getMetaInfo() + * and save the data to disk. + * + * @return the new name for the torrent or null on error + * @since 0.8.4 + */ + public String gotMetaInfo(Snark snark); + + /** + * @since 0.9 + */ + public void fatal(Snark snark, String error); + + /** + * @since 0.9.2 + */ + public void addMessage(Snark snark, String message); + + // not really listeners but the easiest way to get back to an optional SnarkManager + public long getSavedTorrentTime(Snark snark); + public BitField getSavedTorrentBitField(Snark snark); +} diff --git a/apps/i2psnark/java/src/org/klomp/snark/Snark.java b/apps/i2psnark/java/src/org/klomp/snark/Snark.java index f553f54d29f6f3086bd02899c1bbec796c0f1be6..531f3ddff4dbef973da629a786fd8a43ad06a22c 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/Snark.java +++ b/apps/i2psnark/java/src/org/klomp/snark/Snark.java @@ -1204,34 +1204,6 @@ public class Snark completeListener.addMessage(this, message); } - public interface CompleteListener { - public void torrentComplete(Snark snark); - public void updateStatus(Snark snark); - - /** - * We transitioned from magnet mode, we have now initialized our - * metainfo and storage. The listener should now call getMetaInfo() - * and save the data to disk. - * - * @return the new name for the torrent or null on error - * @since 0.8.4 - */ - public String gotMetaInfo(Snark snark); - - /** - * @since 0.9 - */ - public void fatal(Snark snark, String error); - - /** - * @since 0.9.2 - */ - public void addMessage(Snark snark, String message); - - // not really listeners but the easiest way to get back to an optional SnarkManager - public long getSavedTorrentTime(Snark snark); - public BitField getSavedTorrentBitField(Snark snark); - } /** Maintain a configurable total uploader cap * coordinatorListener diff --git a/apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java b/apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java index e0b56b140955a019560a10589626021a177bd902..a0883c05edf286a00a2d16a73d83473940a5c1e6 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java +++ b/apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java @@ -42,7 +42,7 @@ import org.klomp.snark.dht.DHT; /** * Manage multiple snarks */ -public class SnarkManager implements Snark.CompleteListener { +public class SnarkManager implements CompleteListener { /** * Map of (canonical) filename of the .torrent file to Snark instance.