github-advanced-security[bot] commented on code in PR #837:
URL: 
https://github.com/apache/incubator-baremaps/pull/837#discussion_r1505135421


##########
baremaps-core/src/main/java/org/apache/baremaps/workflow/tasks/ExportVectorTiles.java:
##########
@@ -88,7 +95,35 @@
   public void execute(WorkflowContext context) throws Exception {
     var configReader = new ConfigReader();
     var objectMapper = objectMapper();
+
     var tileset = objectMapper.readValue(configReader.read(this.tileset), 
Tileset.class);
+    var style = objectMapper.readValue(configReader.read(this.style), 
Style.class);
+
+    // Write the static files
+    var directory = switch (format) {
+      case file -> repository;
+      case mbtiles -> repository.getParent();
+      case pmtiles -> repository.getParent();
+    };
+    Files.createDirectories(directory);
+    try (var html = 
this.getClass().getResourceAsStream("/static/server.html")) {

Review Comment:
   ## Unsafe use of getResource
   
   The idiom getClass().getResource() is unsafe for classes that may be 
extended.
   
   [Show more 
details](https://github.com/apache/incubator-baremaps/security/code-scanning/955)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to