aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/xyz/brysonsteck/serverfordummies/Download.kt
diff options
context:
space:
mode:
authorBryson Steck <brysonsteck@protonmail.com>2023-05-13 02:24:47 -0600
committerBryson Steck <brysonsteck@protonmail.com>2023-05-13 02:24:47 -0600
commit778e91a2a84b8f011523dfa76cf9545304823c5c (patch)
tree2a42d74e91b0ba5511ef42992eefba3b92de49e6 /app/src/main/kotlin/xyz/brysonsteck/serverfordummies/Download.kt
parentbbf11561cf6598c9dc8ca412dc1f2bb3cc760244 (diff)
downloadServerCraft-778e91a2a84b8f011523dfa76cf9545304823c5c.tar
ServerCraft-778e91a2a84b8f011523dfa76cf9545304823c5c.tar.gz
ServerCraft-778e91a2a84b8f011523dfa76cf9545304823c5c.tar.bz2
download java, prefill checkboxes and choiceboxes
Diffstat (limited to 'app/src/main/kotlin/xyz/brysonsteck/serverfordummies/Download.kt')
-rw-r--r--app/src/main/kotlin/xyz/brysonsteck/serverfordummies/Download.kt6
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();