[jira] [Updated] (HADOOP-14157) FsUrlStreamHandlerFactory "Illegal character in path" parsing file URL on Windows

2017-03-10 Thread Simon Scott (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-14157?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Simon Scott updated HADOOP-14157:
-
Target Version/s: 3.0.0-alpha2, 2.6.5, 2.7.3  (was: 2.7.3, 2.6.5, 
3.0.0-alpha2)
  Status: Open  (was: Patch Available)

> 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: 3.0.0-alpha2, 2.6.5, 2.7.3
> 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.(URI.java:588)
> at java.net.URL.toURI(URL.java:946)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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



[jira] [Updated] (HADOOP-14157) FsUrlStreamHandlerFactory "Illegal character in path" parsing file URL on Windows

2017-03-09 Thread Simon Scott (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-14157?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Simon Scott updated HADOOP-14157:
-
Target Version/s: 3.0.0-alpha2, 2.6.5, 2.7.3  (was: 2.7.3, 2.6.5, 
3.0.0-alpha2)
  Status: Patch Available  (was: Open)

> 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: 3.0.0-alpha2, 2.6.5, 2.7.3
> 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.(URI.java:588)
> at java.net.URL.toURI(URL.java:946)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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



[jira] [Updated] (HADOOP-14157) FsUrlStreamHandlerFactory "Illegal character in path" parsing file URL on Windows

2017-03-09 Thread Simon Scott (JIRA)

 [ 
https://issues.apache.org/jira/browse/HADOOP-14157?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Simon Scott updated HADOOP-14157:
-
Attachment: HADOOP-14157.001.patch

Patch to exercise issue by updating existing test, and also to fix it.

> 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.(URI.java:588)
> at java.net.URL.toURI(URL.java:946)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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



[jira] [Commented] (HADOOP-14157) FsUrlStreamHandlerFactory "Illegal character in path" parsing file URL on Windows

2017-03-08 Thread Simon Scott (JIRA)

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

Simon Scott commented on HADOOP-14157:
--

I have debugged this issue and believe I have a good understanding of the cause.

I believe that registering the {{FsUrlStreamHandlerFactory}} causes it to 
create an {{FsUrlStreamHandler}} instance for use by "file" scheme URLs. So it 
has effectively replaced the usual {{sun.net.www.protocol.file.Handler}}.

When called upon to parse a string into a URL, the 
{{sun.net.www.protocol.file.Handler}} overrides {{parseURL}} in order to 
replace any {{File.separatorChar}} with '/', before calling the 
{{super.parseURL}}.

The {{FsUrlStreamHandler}} does not include this override. So on Windows, 
backslashes can be passed through untranslated and so we have an invalid URL.

> 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
>
> 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.(URI.java:588)
> at java.net.URL.toURI(URL.java:946)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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



[jira] [Created] (HADOOP-14157) FsUrlStreamHandlerFactory "Illegal character in path" parsing file URL on Windows

2017-03-08 Thread Simon Scott (JIRA)
Simon Scott created HADOOP-14157:


 Summary: 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: 3.0.0-alpha2, 2.6.5, 2.7.3
 Environment: Windows
Reporter: Simon Scott
Priority: Minor


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.(URI.java:588)
at java.net.URL.toURI(URL.java:946)
{noformat}




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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