Use canonical path for template dir (#7388)

This commit is contained in:
Hippolyte HENRY
2020-09-14 18:22:14 +02:00
committed by GitHub
parent 4e05912ae7
commit 8dd3e561fa
2 changed files with 2 additions and 2 deletions

View File

@@ -442,7 +442,7 @@ public class WorkflowSettings {
// check to see if the folder exists
if (f.exists() && f.isDirectory()) {
uri = f.toURI();
this.templateDir = Paths.get(uri).toAbsolutePath().toString();
this.templateDir = Paths.get(uri).toAbsolutePath().normalize().toString();
} else {
URL url = this.getClass().getClassLoader().getResource(templateDir);
if (url != null) {

View File

@@ -74,7 +74,7 @@ public class DynamicSettingsTest {
assertNotNull(workflowSettings);
assertEquals(generatorSettings.getGeneratorName(), "none");
assertEquals(workflowSettings.getTemplateDir(), current.getAbsolutePath());
assertEquals(workflowSettings.getTemplateDir(), current.getCanonicalPath());
assertNotEquals(workflowSettings.getTemplateDir(), input);
assertEquals(generatorSettings.getAdditionalProperties().size(), 4);