Skip to content

Commit

Permalink
CupsClient - use string for URI not hostname, change default from ipp…
Browse files Browse the repository at this point in the history
… to ipps.
  • Loading branch information
gmuth committed Jan 31, 2025
1 parent df99693 commit 2c3fada
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/main/kotlin/de/gmuth/ipp/client/CupsClient.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.gmuth.ipp.client

/**
* Copyright (c) 2020-2024 Gerhard Muth
* Copyright (c) 2020-2025 Gerhard Muth
*/

import de.gmuth.ipp.client.IppOperationException.ClientErrorNotFoundException
Expand All @@ -21,10 +21,11 @@ import java.util.logging.Logger.getLogger

// https://www.cups.org/doc/spec-ipp.html
class CupsClient(
val cupsUri: URI = URI.create("ipp://localhost"),
val cupsUri: URI = URI.create("ipps://localhost"),
val ippClient: IppClient = IppClient()
) {
constructor(host: String = "localhost") : this(URI.create("ipp://$host"))
@JvmOverloads
constructor(printerUri: String = "ipps://localhost") : this(URI.create(printerUri))

private val logger = getLogger(javaClass.name)
val config: IppConfig by ippClient::config
Expand Down
2 changes: 1 addition & 1 deletion src/test/kotlin/de/gmuth/ipp/client/CupsClientTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CupsClientTests {
@Test
fun constructors() {
CupsClient()
CupsClient("host")
CupsClient("ipp://host")
}

@Test
Expand Down

0 comments on commit 2c3fada

Please sign in to comment.