hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Becke <be...@u.washington.edu>
Subject Re: Question about parsing of ambiguous URIs
Date Sun, 26 Jan 2003 06:15:52 GMT
I believe this behavior is correct.  The "yadayada/blabla" URI is a 
relative path, like "../index.html".  I think what you're looking for 
is called a net path.  Net paths are required to begin with "//" (e.g. 
"//yadayada/blabla" ).  The BNF for this part is:

       net_path      = "//" authority [ abs_path ]
       abs_path      = "/"  path_segments
       rel_path      = rel_segment [ abs_path ]

Mike


On Saturday, January 25, 2003, at 12:25 PM, Oleg Kalnichevski wrote:

> Sung-Gu
>
> Please have a look at the following code snippet:
>
> URI uri = new URI( "/yadayada/blabla" );
> uri.getHost()); // produces null.
> uri.getPath()); // produces '/yadayada/blabla'.
>
> Everything is cool. However the following behavior appears a bit
> illogical to me:
>
> URI uri = new URI( "yadayada/blabla" );
> uri.getHost()); // produces null. Should not it be 'yadayada'?
> uri.getPath()); // produces 'host/path'. Should not it be '/blabla'?
>
> I believe if uri is incomplete (no explicit protocol specified) and it
> does not begin with / per default URI class constructor should assume
> URI to begin with a host name followed by path, rather then a path with
> host being null.
>
> Is there a reason for current behavior of the URI class constructor?
>
> Thanks
>
> Oleg
>
>
> --
> To unsubscribe, e-mail:   
> <mailto:commons-httpclient-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:commons-httpclient-dev-help@jakarta.apache.org>
>


Mime
View raw message