From: <dam...@us...> - 2006-07-03 19:44:00
|
Revision: 980 Author: damokles Date: 2006-07-03 12:43:52 -0700 (Mon, 03 Jul 2006) ViewCVS: http://svn.sourceforge.net/azcvsupdater/?rev=980&view=rev Log Message: ----------- small change upon request Modified Paths: -------------- trunk/AzCatDest/lbms/azcatdest/main/AzCatDestDownloadListener.java Modified: trunk/AzCatDest/lbms/azcatdest/main/AzCatDestDownloadListener.java =================================================================== --- trunk/AzCatDest/lbms/azcatdest/main/AzCatDestDownloadListener.java 2006-05-23 16:16:07 UTC (rev 979) +++ trunk/AzCatDest/lbms/azcatdest/main/AzCatDestDownloadListener.java 2006-07-03 19:43:52 UTC (rev 980) @@ -6,26 +6,26 @@ import org.gudy.azureus2.plugins.torrent.TorrentAttribute; public class AzCatDestDownloadListener implements org.gudy.azureus2.plugins.download.DownloadListener { - + static private AzCatDestDownloadListener instance = new AzCatDestDownloadListener(); static private TorrentAttribute ta = Plugin.getPluginInterface().getTorrentManager().getAttribute(TorrentAttribute.TA_CATEGORY); - + private AzCatDestDownloadListener() {} - + public static AzCatDestDownloadListener getInstance() { return instance; } - + public void positionChanged(Download download, int oldPosition, int newPosition) { } - + public void stateChanged(final Download download, int old_state, int new_state) { - if (new_state == Download.ST_SEEDING) { + if (old_state == Download.ST_DOWNLOADING && new_state == Download.ST_SEEDING) { String cat = download.getAttribute(ta); download.removeListener(instance); //remove listener so it wont be triggered twice - if (cat != null) { //a Category was + if (cat != null) { //a Category was try { - String dest = Plugin.getProperties().getProperty(cat, null); + String dest = Plugin.getProperties().getProperty(cat, null); if (dest!=null) { if(!dest.equalsIgnoreCase("")) { File destFile = new File(dest); @@ -37,7 +37,7 @@ // TODO Auto-generated catch block e.printStackTrace(); } - } + } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |