diff options
Diffstat (limited to 'app/src/main/kotlin/xyz/brysonsteck/serverfordummies/Download.kt')
-rw-r--r-- | app/src/main/kotlin/xyz/brysonsteck/serverfordummies/Download.kt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/src/main/kotlin/xyz/brysonsteck/serverfordummies/Download.kt b/app/src/main/kotlin/xyz/brysonsteck/serverfordummies/Download.kt index 07a6eca..b98b511 100644 --- a/app/src/main/kotlin/xyz/brysonsteck/serverfordummies/Download.kt +++ b/app/src/main/kotlin/xyz/brysonsteck/serverfordummies/Download.kt @@ -14,9 +14,11 @@ class Download: Runnable { private final val MAX_BUFFER_SIZE: Number = 1024 private var url: URL + private var dir: String - constructor (url: URL) { + constructor (url: URL, dir: String) { this.url = url + this.dir = dir size = -1 downloaded = 0 status = Status.DOWNLOADING @@ -65,7 +67,7 @@ class Download: Runnable { } // Open file and seek to the end of it. - file = RandomAccessFile(getFilename(url), "rw"); + file = RandomAccessFile(dir + getFilename(url), "rw"); file.seek(downloaded.toLong()); stream = connection.getInputStream(); |