From b2d82bddd39d61c81ce14086809d817a1475e0b5 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Fri, 26 Feb 2021 10:45:00 +0000 Subject: Support for JDK 8 (and 11) --- server/src/net/usebox/gemini/server/Server.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'server/src/net') diff --git a/server/src/net/usebox/gemini/server/Server.scala b/server/src/net/usebox/gemini/server/Server.scala index c2fcee3..ed9252d 100644 --- a/server/src/net/usebox/gemini/server/Server.scala +++ b/server/src/net/usebox/gemini/server/Server.scala @@ -3,8 +3,7 @@ package net.usebox.gemini.server import java.nio.charset.Charset import javax.net.ssl.SSLEngine import java.net.URI -import java.nio.file.Path -import java.nio.file.Files +import java.nio.file.{Path, FileSystems, Files} import scala.util.{Try, Success => TrySuccess} @@ -102,7 +101,10 @@ case class Server(conf: ServiceConf) { logger.debug("redirect to normalize uri") PermanentRedirect(req, uri.normalize().toString()) case ("gemini", host, path, Some(vhost)) => - val resource = Path.of(vhost.root, path).normalize() + val resource = FileSystems + .getDefault() + .getPath(vhost.root, path) + .normalize() logger.debug(s"requesting: '$resource'") -- cgit v1.2.3