Add java.nio.file.Paths import

Annoyingly a bunch of IDEA's refactoring tools seem to cause imports to
disappear.

Signed-off-by: Graham <gpe@openrs2.dev>
bzip2
Graham 5 years ago
parent 4a40b2cc68
commit 231e0893af
  1. 5
      cli/src/main/java/dev/openrs2/cli/OptionExtensions.kt

@ -8,13 +8,14 @@ import com.github.ajalt.clikt.parameters.options.default
import java.io.InputStream import java.io.InputStream
import java.io.OutputStream import java.io.OutputStream
import java.nio.file.Files import java.nio.file.Files
import java.nio.file.Paths
fun RawOption.inputStream(): NullableOption<InputStream, InputStream> { fun RawOption.inputStream(): NullableOption<InputStream, InputStream> {
return convert("FILE") { return convert("FILE") {
return@convert if (it == "-") { return@convert if (it == "-") {
System.`in` System.`in`
} else { } else {
Files.newInputStream(java.nio.file.Paths.get(it)) Files.newInputStream(Paths.get(it))
} }
} }
} }
@ -28,7 +29,7 @@ fun RawOption.outputStream(): NullableOption<OutputStream, OutputStream> {
return@convert if (it == "-") { return@convert if (it == "-") {
System.out System.out
} else { } else {
Files.newOutputStream(java.nio.file.Paths.get(it)) Files.newOutputStream(Paths.get(it))
} }
} }
} }

Loading…
Cancel
Save