Made parseMethodResponse() internal.

This commit is contained in:
Erik C. Thauvin 2019-05-26 18:13:20 -07:00
parent df70a795b8
commit 462c0813bf

View file

@ -194,7 +194,7 @@ open class PinboardPoster() {
return false
}
fun parseMethodResponse(method: String, response: String) {
internal fun parseMethodResponse(method: String, response: String) {
val factory = DocumentBuilderFactory.newInstance().apply {
isValidating = false
isIgnoringElementContentWhitespace = true
@ -223,6 +223,14 @@ open class PinboardPoster() {
}
}
private fun cleanEndPoint(method: String): String {
return if (apiEndPoint.endsWith('/')) {
"$apiEndPoint$method"
} else {
"$apiEndPoint/$method"
}
}
private fun executeMethod(method: String, params: List<Pair<String, String>>): Boolean {
val apiUrl = HttpUrl.parse(cleanEndPoint(method))
if (apiUrl != null) {
@ -259,14 +267,6 @@ open class PinboardPoster() {
return false
}
private fun cleanEndPoint(method: String): String {
return if (apiEndPoint.endsWith('/')) {
"$apiEndPoint$method"
} else {
"$apiEndPoint/$method"
}
}
private fun logHttp(method: String, msg: String) {
logger.logp(Level.FINE, PinboardPoster::class.java.name, "executeMethod($method)", msg)
}