Skip to content

Commit 3dbbbe4

Browse files
committed
fix Android issue "failed to create directory" (context of issue #41)
1 parent ebbb2cd commit 3dbbbe4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/kotlin/de/gmuth/ipp/client/CupsClient.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ class CupsClient(
7676

7777
fun getPrinter(printerName: String) =
7878
try {
79-
IppPrinter(printerUri = cupsPrinterUri(printerName), ippClient = ippClient)
80-
.apply { printerDirectory = File(cupsDirectory, printerName).createDirectoryIfNotExists() }
79+
IppPrinter(printerUri = cupsPrinterUri(printerName), ippClient = ippClient).apply {
80+
printerDirectory = File(cupsDirectory, printerName).createDirectoryIfNotExists(false)
81+
}
8182
} catch (clientErrorNotFoundException: ClientErrorNotFoundException) {
8283
with(getPrinters()) {
8384
if (isNotEmpty()) logger.warning { "Available CUPS printers: ${map { it.name }}" }

0 commit comments

Comments
 (0)