hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-14157) FsUrlStreamHandlerFactory "Illegal character in path" parsing file URL on Windows
Date Sat, 28 Oct 2017 21:09:00 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-14157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16223736#comment-16223736
] 

ASF GitHub Bot commented on HADOOP-14157:
-----------------------------------------

GitHub user bberton-ciandt opened a pull request:

    https://github.com/apache/hadoop/pull/284

    [HADOOP-14157] fix parseUrl to replace '\' for '/'

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/bberton-ciandt/hadoop HADOOP-14157

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/hadoop/pull/284.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #284
    
----
commit 2d563d66946888e4c906370fd7a07fa33c83bd61
Author: bberton-ciandt <bberton@ciandt.com>
Date:   2017-10-28T21:08:07Z

    [HADOOP-14157] fix parseUrl to replace '\' for '/'

----


> FsUrlStreamHandlerFactory "Illegal character in path" parsing file URL on Windows
> ---------------------------------------------------------------------------------
>
>                 Key: HADOOP-14157
>                 URL: https://issues.apache.org/jira/browse/HADOOP-14157
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 2.7.3, 2.6.5, 3.0.0-alpha2
>         Environment: Windows
>            Reporter: Simon Scott
>            Priority: Minor
>         Attachments: HADOOP-14157.001.patch
>
>
> After registering the FsUrlStreamHandlerFactory with the JVM, subsequent calls to convert
a "file" URL to a URI can fail with "Illegal character in path" where the illegal character
is a backslash.
> For example:
> {code}
> URL.setURLStreamHandlerFactory(new FsUrlStreamHandlerFactory());
> File file = new File("C:/Users");
> final URL url = new URL("file:///" + file.getAbsolutePath());
> {code}
> gives stack trace:
> {noformat}
> java.net.URISyntaxException: Illegal character in path at index 8: file:/C:\Users
>     at java.net.URI$Parser.fail(URI.java:2848)
>     at java.net.URI$Parser.checkChars(URI.java:3021)
>     at java.net.URI$Parser.parseHierarchical(URI.java:3105)
>     at java.net.URI$Parser.parse(URI.java:3053)
>     at java.net.URI.<init>(URI.java:588)
>     at java.net.URL.toURI(URL.java:946)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message