Checked for duplicates
Yes - I've already checked
🐛 Describe the bug
When validating a PDS4 label containing a directory_path_name value that starts with / (e.g. /test/meca_rdr_sis_files/), the error.directory.unallowed_name error is raised on Linux/macOS but not on Windows.
The root cause is in FileReferenceValidationRule.java: the code uses java.nio.file.Path.isAbsolute() to detect absolute paths, which is OS-dependent. On Windows, Path.isAbsolute() returns false for paths that start with / but lack a drive letter (e.g. C:\) — Java treats these as "drive-relative" rather than absolute. On Linux/macOS, the same path correctly returns true.
First identified as a cross-platform inconsistency in NASA-PDS/pds4-information-model#1001.
🕵️ Expected behavior
error.directory.unallowed_name should be raised on all platforms when directory_path_name contains an absolute path (starts with /), since PDS4 uses forward-slash separators by definition and the check should be platform-independent.
📜 To Reproduce
- Create a PDS4 label with
<directory_path_name>/test/meca_rdr_sis_files/</directory_path_name>
- Run
validate on Windows
- Observe that
error.directory.unallowed_name is not raised (only error.label.schema is raised)
- Run the same validate command on Linux/macOS
- Observe that
error.directory.unallowed_name is raised
🖥 Environment Info
- Version of this software: v4.0.1
- Operating System: Windows (missing error) vs Linux/macOS (correct behavior)
📚 Version of Software Used
v4.0.1
🩺 Test Data / Additional context
See Product_Document_FAIL_pathname_20260316.xml (file06: <directory_path_name>/test/meca_rdr_sis_files/</directory_path_name>).
Fix: Replace Paths.get(FilenameUtils.getFullPath(directory)).isAbsolute() with directory.startsWith("/") in FileReferenceValidationRule.java.
Related: NASA-PDS/pds4-information-model#1001
For Internal Dev Team To Complete
⚙️ Engineering Details
🎉 Integration & Test
Checked for duplicates
Yes - I've already checked
🐛 Describe the bug
When validating a PDS4 label containing a
directory_path_namevalue that starts with/(e.g./test/meca_rdr_sis_files/), theerror.directory.unallowed_nameerror is raised on Linux/macOS but not on Windows.The root cause is in
FileReferenceValidationRule.java: the code usesjava.nio.file.Path.isAbsolute()to detect absolute paths, which is OS-dependent. On Windows,Path.isAbsolute()returnsfalsefor paths that start with/but lack a drive letter (e.g.C:\) — Java treats these as "drive-relative" rather than absolute. On Linux/macOS, the same path correctly returnstrue.First identified as a cross-platform inconsistency in NASA-PDS/pds4-information-model#1001.
🕵️ Expected behavior
error.directory.unallowed_nameshould be raised on all platforms whendirectory_path_namecontains an absolute path (starts with/), since PDS4 uses forward-slash separators by definition and the check should be platform-independent.📜 To Reproduce
<directory_path_name>/test/meca_rdr_sis_files/</directory_path_name>validateon Windowserror.directory.unallowed_nameis not raised (onlyerror.label.schemais raised)error.directory.unallowed_nameis raised🖥 Environment Info
📚 Version of Software Used
v4.0.1
🩺 Test Data / Additional context
See
Product_Document_FAIL_pathname_20260316.xml(file06:<directory_path_name>/test/meca_rdr_sis_files/</directory_path_name>).Fix: Replace
Paths.get(FilenameUtils.getFullPath(directory)).isAbsolute()withdirectory.startsWith("/")inFileReferenceValidationRule.java.Related: NASA-PDS/pds4-information-model#1001
For Internal Dev Team To Complete
⚙️ Engineering Details
🎉 Integration & Test