mirror of
https://github.com/anthonyraymond/joal.git
synced 2024-09-20 15:26:25 +08:00
rename TorrentFileChangeAware methods
This commit is contained in:
parent
2696425bfe
commit
bffcb85af3
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue