[kotlin][client] fix Android crash on API level 25 and bellow (#9578)

* [kotlin][client] fix Android crash on API level

* [kotlin][client] update sample project

* Try to fix CI

* [kotlin][client] add flag to control android api level supported

* [kotlin][client] update docs

* [kotlin][client] update docs
This commit is contained in:
Bruno Coelho
2021-05-26 11:24:52 +01:00
committed by GitHub
parent a1f539ce6e
commit 163d13e415
16 changed files with 38 additions and 26 deletions

View File

@@ -16,7 +16,6 @@ import java.io.File
import java.io.BufferedWriter
import java.io.FileWriter
import java.net.URLConnection
import java.nio.file.Files
import java.util.Date
import java.time.LocalDate
import java.time.LocalDateTime
@@ -119,7 +118,7 @@ open class ApiClient(val baseUrl: String) {
}
if (T::class.java == File::class.java) {
// return tempfile
val f = Files.createTempFile("tmp.org.openapitools.client", null).toFile()
val f = java.nio.file.Files.createTempFile("tmp.org.openapitools.client", null).toFile()
f.deleteOnExit()
val out = BufferedWriter(FileWriter(f))
out.write(bodyContent)