Closed GoogleCodeExporter closed 8 years ago
Possible fix: use File#isAbsolute which is platform independent.
public File resolvePath(String filePath) {
File file = new File(filePath);
if(!file.isAbsolute())
file = new File(basePath, filePath);
The patch also includes test cases for absolute path handling and
fixes for all path related test cases to run on Windows.
Original comment by mistae...@gmail.com
on 5 Oct 2011 at 2:27
Attachments:
Can you fill out http://code.google.com/legal/individual-cla-v1.0.html and let
me know when you do? After that, I can apply the patch.
Original comment by corbinrs...@gmail.com
on 7 Oct 2011 at 10:02
[deleted comment]
Done!
Original comment by mistae...@gmail.com
on 8 Oct 2011 at 2:30
As of r1064
Slated for 1.3.3c
Original comment by corbinrs...@gmail.com
on 8 Oct 2011 at 6:56
Absolute paths still fail on OS X. It looks like the mistake is that
PathResolver.resolve(Set<FileInfo> unresolvedFiles) doesn't call the method
above. It calls expandFileInfosFromFileInfo which does this:
for (File basePath : basePaths) {
File file = new File(basePath, filePath); <-- WRONG, no check for file being absolute.
Tracing it through YAMLParser.parse() calls
resolvedFilesLoad.addAll(createFileInfos((List<String>) data
.get("load"), false));
(which despite the name, isn't resolved files)
This then gets passed into new ParsedConfiguration(...)
which then has its resolvePaths(pathResolver, flags) method called
which calls pathResolver.resolve(Set<FileInfo> unresolvedFiles)
which then calls expandFileInfosFromFileInfo() which has this bug.
Original comment by brian.ew...@gmail.com
on 26 Apr 2012 at 1:42
Absolute paths also fail on Linux in 1.3.4.b.
This used to work in 1.3.2.
Original comment by bernd.pa...@gmail.com
on 7 Sep 2012 at 6:05
Original issue reported on code.google.com by
mistae...@gmail.com
on 5 Oct 2011 at 2:20