[F] Fix warnings

This commit is contained in:
Azalea
2024-11-21 12:26:36 -05:00
parent a947a81772
commit 0e176d5608
4 changed files with 5 additions and 5 deletions

View File

@@ -11,7 +11,7 @@ import org.springframework.context.annotation.Configuration
import org.springframework.stereotype.Service
import java.io.File
import java.net.InetAddress
import java.net.URL
import java.net.URI
import java.nio.file.Files
@@ -38,7 +38,7 @@ class GeoIP(
// Download from GitHub
try {
log.info("Downloading GeoLite2 database to ${props.geoLitePath}")
URL("https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-Country.mmdb").openStream()
URI("https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-Country.mmdb").toURL().openStream()
.use { Files.copy(it, File(props.geoLitePath).toPath()) }
} catch (e: Exception) {
log.error("Failed to download GeoLite2 database", e)