Lerm/metadata — comment on commit 0b14bfcc5cc7ecdb50c6f2f4c062efdd34618e48
File:  line 0
By Lerm:

The parser generates following URLs:
file://
For example:
file:///tmp/something.xsd
As we can see, such URL contains double forward slash (//). However, java.net.URL/URI doesn't generate that part if URI has no hostname. So, if we create an URI from File object, then in Java it will have following format:
file:/tmp/something.xsd
Of course, we can use the getRawPath and just prepend the 'file://' part - however 'getRawPath' doesn't encode symbols with codes above 0x80. So, in order to get the properly encoded URL, we need to call toASCIIString. So, in order to get the URL in the required format, we call getASCIIString, remove the 'file:' part (substring(5)) and prepend 'file://' element.

29.12.2011, 12:39, "Jean-Frederic Clere" :
> substring(5) Why?
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/Lerm/metadata/commit/0b14bfcc5cc7ecdb50c6f2f4c062efdd34618e48#commitcomment-825799