Skip to content

Commit

Permalink
Fixed problem with Paths having different behaviour depending on OS
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosjepard authored and hmiguim committed Nov 5, 2024
1 parent 86d2d55 commit 34bb2c1
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
public class DecoderUtils {

public static String normalizePath(String href) {
return Paths.get(href).normalize().toString();

return Paths.get(href).normalize() // Removes unnecessary elements (like "." or "..")
.toString().replace("\\", "/"); // Assure it returns in unix-style format

}

}

0 comments on commit 34bb2c1

Please sign in to comment.