Skip to content

Commit

Permalink
fixed bug in save()
Browse files Browse the repository at this point in the history
  • Loading branch information
gmuth committed Sep 29, 2024
1 parent eee7a04 commit c46d11e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/kotlin/de/gmuth/ipp/client/IppDocument.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ class IppDocument(
filename: String = filename(),
overwrite: Boolean = true
) = File(directory, filename).also {
if (!directory.exists()) directory.mkdirs()
if (it.isFile && !overwrite) throw IOException("File '$it' already exists")
if (!it.exists()) it.mkdirs()
copyTo(it.outputStream())
this.file = it
logger.info { "Saved $file ${if (attributes.containsKey("document-format")) "($format)" else ""}" }
Expand Down

0 comments on commit c46d11e

Please sign in to comment.