X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fxdcc%2Fdata%2FDownload.java;fp=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fxdcc%2Fdata%2FDownload.java;h=5190ed054faa991c588ebc4274fe35d40023dfff;hb=6b97ecef1be59f3746e859dfb4a65f2195a6ee90;hp=2d95537ef75da119e8edc97ba5eea2ffb71b0704;hpb=3f465810809aa9d3dd2402b2aab6fbc5f62e6e75;p=xudocci.git diff --git a/src/main/java/net/pterodactylus/xdcc/data/Download.java b/src/main/java/net/pterodactylus/xdcc/data/Download.java index 2d95537..5190ed0 100644 --- a/src/main/java/net/pterodactylus/xdcc/data/Download.java +++ b/src/main/java/net/pterodactylus/xdcc/data/Download.java @@ -18,6 +18,7 @@ package net.pterodactylus.xdcc.data; import java.io.OutputStream; +import java.net.InetAddress; import net.pterodactylus.irc.DccReceiver; @@ -37,6 +38,12 @@ public class Download { /** The name of the file being downloaded. */ private String filename; + /** The size of the file being downloaded. */ + private long filesize; + + /** The remote address. */ + private InetAddress remoteAddress; + /** The output stream. */ private OutputStream outputStream; @@ -88,6 +95,24 @@ public class Download { } /** + * Returns the size of the file. + * + * @return The size of the file + */ + public long filesize() { + return filesize; + } + + /** + * Returns the remote address to download from. + * + * @return The remote address to download from + */ + public InetAddress remoteAddress() { + return remoteAddress; + } + + /** * The output stream that writes to the file. * * @return The output stream @@ -122,6 +147,30 @@ public class Download { } /** + * Sets the size of the download. + * + * @param filesize + * The size of the download + * @return This download + */ + public Download filesize(long filesize) { + this.filesize = filesize; + return this; + } + + /** + * Sets the remote address of the download. + * + * @param remoteAddress + * The remote address of the download + * @return This download + */ + public Download remoteAddress(InetAddress remoteAddress) { + this.remoteAddress = remoteAddress; + return this; + } + + /** * Sets the output stream the download is being written to * * @param outputStream