Compare commits

...

2 Commits

Author SHA1 Message Date
47f25c5064 Update dependencies 2024-04-09 19:18:36 +02:00
951a659be1 Fix URL deprecation warnings 2024-04-09 19:18:36 +02:00
3 changed files with 9 additions and 9 deletions

View File

@ -15,11 +15,11 @@ repositories {
dependencies { dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web:3.2.4' implementation 'org.springframework.boot:spring-boot-starter-web:3.2.4'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.9.23' implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.9.23'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0'
implementation 'org.jsoup:jsoup:1.15.3' implementation 'org.jsoup:jsoup:1.17.2'
implementation 'com.google.code.gson:gson:2.10' implementation 'com.google.code.gson:gson:2.10.1'
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2' testImplementation 'org.junit.jupiter:junit-jupiter:5.10.2'
} }
test { test {

View File

@ -29,7 +29,7 @@ import java.io.BufferedReader
import java.io.IOException import java.io.IOException
import java.io.InputStreamReader import java.io.InputStreamReader
import java.net.HttpURLConnection import java.net.HttpURLConnection
import java.net.URL import java.net.URI
class CachetAPIController { class CachetAPIController {
@ -41,7 +41,7 @@ class CachetAPIController {
fun postTotalRequests() { fun postTotalRequests() {
try { try {
val url = URL("${StartupController.cachetBaseURL}/api/v1/metrics/1/points") val url = URI("${StartupController.cachetBaseURL}/api/v1/metrics/1/points").toURL()
val jsonInputString = "{\"value\": ${totalRequests -oldTotalRequests}, \"timestamp\": \"${(System.currentTimeMillis() / 1000)}\"}" val jsonInputString = "{\"value\": ${totalRequests -oldTotalRequests}, \"timestamp\": \"${(System.currentTimeMillis() / 1000)}\"}"
oldTotalRequests = totalRequests oldTotalRequests = totalRequests

View File

@ -29,7 +29,7 @@ import org.mosad.thecitadelofricks.Status
import org.slf4j.Logger import org.slf4j.Logger
import org.slf4j.LoggerFactory import org.slf4j.LoggerFactory
import java.net.HttpURLConnection import java.net.HttpURLConnection
import java.net.URL import java.net.URI
import java.time.LocalDateTime import java.time.LocalDateTime
import java.util.* import java.util.*
import kotlin.collections.HashMap import kotlin.collections.HashMap
@ -90,8 +90,8 @@ class StatusController {
var swfrCode = 999 var swfrCode = 999
try { try {
val hsoURL = URL("https://www.hs-offenburg.de/") val hsoURL = URI("https://www.hs-offenburg.de/").toURL()
val swfrURL = URL("https://www.swfr.de/") val swfrURL = URI("https://www.swfr.de/").toURL()
var connection = hsoURL.openConnection() as HttpURLConnection var connection = hsoURL.openConnection() as HttpURLConnection
connection.requestMethod = "HEAD" connection.requestMethod = "HEAD"