From 198eb138dc609e4f302a9096ea67c6d1ac5516d2 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Fri, 20 Jul 2018 15:58:43 +0100 Subject: [PATCH] Downloaded file and event --- .../core/files/FileDownloadedEvent.groovy | 5 ++--- .../java/com/muwire/core/DownloadedFile.java | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 core/src/main/java/com/muwire/core/DownloadedFile.java diff --git a/core/src/main/groovy/com/muwire/core/files/FileDownloadedEvent.groovy b/core/src/main/groovy/com/muwire/core/files/FileDownloadedEvent.groovy index f9db133e..0af89617 100644 --- a/core/src/main/groovy/com/muwire/core/files/FileDownloadedEvent.groovy +++ b/core/src/main/groovy/com/muwire/core/files/FileDownloadedEvent.groovy @@ -1,12 +1,11 @@ package com.muwire.core.files +import com.muwire.core.DownloadedFile import com.muwire.core.Event -import com.muwire.core.SharedFile import net.i2p.data.Destination class FileDownloadedEvent extends Event { - SharedFile downloadedFile - List sources + DownloadedFile downloadedFile } diff --git a/core/src/main/java/com/muwire/core/DownloadedFile.java b/core/src/main/java/com/muwire/core/DownloadedFile.java new file mode 100644 index 00000000..2e99eb36 --- /dev/null +++ b/core/src/main/java/com/muwire/core/DownloadedFile.java @@ -0,0 +1,21 @@ +package com.muwire.core; + +import java.io.File; +import java.util.Set; + +import net.i2p.data.Destination; + +public class DownloadedFile extends SharedFile { + + private final Set sources; + + public DownloadedFile(File file, InfoHash infoHash, Set sources) { + super(file, infoHash); + this.sources = sources; + } + + public Set getSources() { + return sources; + } + +}