diff --git a/examples/src/main/scala/sttp/client4/examples/DowloadFileWitOsLib.scala b/examples/src/main/scala/sttp/client4/examples/downloadFileWitOsLib.scala similarity index 81% rename from examples/src/main/scala/sttp/client4/examples/DowloadFileWitOsLib.scala rename to examples/src/main/scala/sttp/client4/examples/downloadFileWitOsLib.scala index c8c576e05..8f926f331 100644 --- a/examples/src/main/scala/sttp/client4/examples/DowloadFileWitOsLib.scala +++ b/examples/src/main/scala/sttp/client4/examples/downloadFileWitOsLib.scala @@ -7,8 +7,7 @@ import sttp.client4.* import os.* private val fileSize = 8192 -private val dest: os.Path = - os.pwd / "examples" / "src" / "main" / "resources" / s"file-example-$fileSize-bytes" +private val dest: os.Path = os.Path(s"/tmp/file-example-$fileSize-bytes") private val backend: SyncBackend = DefaultSyncBackend() @main def downloadFileWithOsLib(): Unit = { diff --git a/examples/src/main/scala/sttp/client4/examples/UploadFileWithOsLib.scala b/examples/src/main/scala/sttp/client4/examples/uploadFileWithOsLib.scala similarity index 78% rename from examples/src/main/scala/sttp/client4/examples/UploadFileWithOsLib.scala rename to examples/src/main/scala/sttp/client4/examples/uploadFileWithOsLib.scala index 252bce20e..24c66683c 100644 --- a/examples/src/main/scala/sttp/client4/examples/UploadFileWithOsLib.scala +++ b/examples/src/main/scala/sttp/client4/examples/uploadFileWithOsLib.scala @@ -6,11 +6,12 @@ package sttp.client4.examples import sttp.client4.* import os.* -private val path: os.Path = - os.pwd / "examples" / "src" / "main" / "resources" / "some-text-file.txt" +private val path: os.Path = os.Path("/tmp/example-file.txt") private val backend: SyncBackend = DefaultSyncBackend() @main def uploadFileWithOsLib(): Unit = { + os.remove(path) + os.write(path, "THIS IS CONTENT OF TEST FILE") val request = basicRequest .post(uri"http://httpbin.org/post") .body(os.read.inputStream(path))