flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zentol <...@git.apache.org>
Subject [GitHub] incubator-flink pull request: [FLINK-1270] FS.get() supports relat...
Date Sat, 22 Nov 2014 19:25:38 GMT
Github user zentol commented on the pull request:

    Path relativePath = new Path("wordcount.py");
    Path absolutePath = relativePath.makeQualified(relativePath.getFileSystem());
    This code fails since its not an absolute path. I think it absolutely should work since
relative paths are so common. without *some* change, supporting relative paths is always a
clunky affair since you have to check for scheme's yourself before using `getAbsolutePath()`.
    Regarding normalization: We could move `uri = new URI("file", null, new File(uri.getPath()).getAbsolutePath(),
null);` into the URISyntaxException block. It will only be executed if the current code fails
anyway, and as such shouldn't affect working code.
    Regarding forgotten slashes:  If you go through the Path class the scheme will be correctly
identified no matter how many slashes are behind `file:`, and if there are none it throws
an exception in the constructor. The only problematic case i can think of is : `FileSystem.get(new
URI("file:world.txt"))`. In this case, getPath would return null. But since the scheme is
correctly identified as `file` the code in questions will not be executed, and as such has
no bearing on this issue.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message