Skip to content

Commit

Permalink
use different method to parse assets path
Browse files Browse the repository at this point in the history
  • Loading branch information
celuchmarek committed Jan 23, 2025
1 parent b202e3b commit 4040e71
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
import digital.slovensko.autogram.server.errors.InvalidUrlParamException;

import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;

import static java.util.Objects.requireNonNull;
Expand All @@ -16,7 +18,11 @@ public class AssetsEndpoint implements HttpHandler {
private static final List<String> assets;
private static final Path assetsPath;
static {
assetsPath = Path.of(requireNonNull(AssetsEndpoint.class.getResource("index.html")).getPath()).getParent().resolve("assets");
try {
assetsPath = Paths.get(requireNonNull(AssetsEndpoint.class.getResource("index.html")).toURI()).getParent().resolve("assets");
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
assets = List.of(
"swagger-ui-bundle-v5.11.0.js",
"swagger-ui-v5.11.0.css"
Expand Down

0 comments on commit 4040e71

Please sign in to comment.