mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Gaetan Boismal
02.07.2015 ca097c64e8cec05e8994a8b64d1bd9f994e54421
OPENDJ-1684 PR-71 Fix addrate and makeldif template path

If the template file path provided is relative, We need to retrieve the cannonical file before accessing the parent file.
With a relative path, file.getParentFile() returns null which caused the NPE.
1 files modified
2 ■■■ changed files
opendj-core/src/main/java/org/forgerock/opendj/ldif/TemplateFile.java 2 ●●● patch | view | raw | blame | history
opendj-core/src/main/java/org/forgerock/opendj/ldif/TemplateFile.java
@@ -373,7 +373,7 @@
                // Use the template file directory as resource path
                final File file = getFile(templateFilename);
                if (file != null) {
                    resourcePath = file.getParentFile().getAbsolutePath();
                    resourcePath = file.getCanonicalFile().getParentFile().getAbsolutePath();
                }
            }
            final List<String> fileLines = readLines(templateReader);