Skip to content

Commit

Permalink
TemplatesUriLocator.locate assumes file system path separator is uri …
Browse files Browse the repository at this point in the history
…path separator #3328

Thanks @yuanb
  • Loading branch information
fxprunayre committed Dec 7, 2018
1 parent fb632ab commit ecb1220
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -61,9 +61,9 @@ public InputStream locate(String uri) throws IOException {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
if (!Files.isDirectory(file) && file.getFileName().toString().endsWith("html")) {
String fileFolder = file.getParent().toString();
String fileFolder = file.getParent().toUri().toString();
String relativeFileFolderPath = fileFolder.substring(fileFolder.indexOf(path));
addFileToTemplateCache(javascript, "../.." + relativeFileFolderPath.replace('\\', '/') + '/' + file.getFileName(), file.toFile());
addFileToTemplateCache(javascript, "../.." + relativeFileFolderPath + file.getFileName(), file.toFile());
}
return FileVisitResult.CONTINUE;
}
Expand Down

0 comments on commit ecb1220

Please sign in to comment.