diff --git a/src/main/java/org/araymond/joal/core/torrent/watcher/TorrentFileChangeAware.java b/src/main/java/org/araymond/joal/core/torrent/watcher/TorrentFileChangeAware.java index caf1589..e6846f1 100644 --- a/src/main/java/org/araymond/joal/core/torrent/watcher/TorrentFileChangeAware.java +++ b/src/main/java/org/araymond/joal/core/torrent/watcher/TorrentFileChangeAware.java @@ -7,8 +7,8 @@ import org.araymond.joal.core.ttorent.client.MockedTorrent; */ public interface TorrentFileChangeAware { - void onTorrentAdded(final MockedTorrent torrent); + void onTorrentFileAdded(final MockedTorrent torrent); - void onTorrentRemoved(final MockedTorrent torrent); + void onTorrentFileRemoved(final MockedTorrent torrent); } diff --git a/src/main/java/org/araymond/joal/core/torrent/watcher/TorrentFileProvider.java b/src/main/java/org/araymond/joal/core/torrent/watcher/TorrentFileProvider.java index 42869d5..78f78f6 100644 --- a/src/main/java/org/araymond/joal/core/torrent/watcher/TorrentFileProvider.java +++ b/src/main/java/org/araymond/joal/core/torrent/watcher/TorrentFileProvider.java @@ -100,7 +100,7 @@ public class TorrentFileProvider extends FileAlterationListenerAdaptor implement logger.info("Torrent file deleting detected, hot deleted file: {}", file.getAbsolutePath()); this.torrentFiles.remove(file); - this.torrentFileChangeListener.forEach(listener -> listener.onTorrentRemoved(torrent)); + this.torrentFileChangeListener.forEach(listener -> listener.onTorrentFileRemoved(torrent)); this.publisher.publishEvent(new TorrentFileDeletedEvent(torrent)); } @@ -111,7 +111,7 @@ public class TorrentFileProvider extends FileAlterationListenerAdaptor implement final MockedTorrent torrent = MockedTorrent.fromFile(file); this.torrentFiles.put(file, torrent); if (this.isInitOver) { - this.torrentFileChangeListener.forEach(listener -> listener.onTorrentAdded(torrent)); + this.torrentFileChangeListener.forEach(listener -> listener.onTorrentFileAdded(torrent)); } this.publisher.publishEvent(new TorrentFileAddedEvent(torrent)); } catch (final IOException | NoSuchAlgorithmException e) { diff --git a/src/main/java/org/araymond/joal/core/ttorent/client/Client.java b/src/main/java/org/araymond/joal/core/ttorent/client/Client.java index 67d2032..463a2bc 100644 --- a/src/main/java/org/araymond/joal/core/ttorent/client/Client.java +++ b/src/main/java/org/araymond/joal/core/ttorent/client/Client.java @@ -106,7 +106,7 @@ public class Client implements AnnouncerEventListener, TorrentFileChangeAware { } @Override - public void onTorrentAdded(final MockedTorrent torrent) { + public void onTorrentFileAdded(final MockedTorrent torrent) { if (this.currentState != ClientState.STARTED) { return; } @@ -117,7 +117,7 @@ public class Client implements AnnouncerEventListener, TorrentFileChangeAware { } @Override - public void onTorrentRemoved(final MockedTorrent torrent) { + public void onTorrentFileRemoved(final MockedTorrent torrent) { // Work on a copy of the list for concurrency purpose (otherwise manually removing a torrent cause the app to crash) for (final Announcer announcer : Lists.newArrayList(this.announcers)) { if (announcer.isForTorrent(torrent)) { diff --git a/src/test/java/org/araymond/joal/core/torrent/watcher/TorrentFileProviderTest.java b/src/test/java/org/araymond/joal/core/torrent/watcher/TorrentFileProviderTest.java index b956f05..8609034 100644 --- a/src/test/java/org/araymond/joal/core/torrent/watcher/TorrentFileProviderTest.java +++ b/src/test/java/org/araymond/joal/core/torrent/watcher/TorrentFileProviderTest.java @@ -289,12 +289,12 @@ public class TorrentFileProviderTest { } @Override - public void onTorrentAdded(final MockedTorrent torrent) { + public void onTorrentFileAdded(final MockedTorrent torrent) { createLock.countDown(); } @Override - public void onTorrentRemoved(final MockedTorrent torrent) { + public void onTorrentFileRemoved(final MockedTorrent torrent) { deleteLock.countDown(); } }