Re: Question about parsing of ambiguous URIs

2003-01-26 Thread Oleg Kalnichevski
Thanks for clarifications, Mike
Cheers
Oleg


On Sun, 2003-01-26 at 07:15, Michael Becke wrote:
> 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:   
> > 
> > For additional commands, e-mail: 
> > 
> >
> 
> 
> --
> To unsubscribe, e-mail:   
>
> For additional commands, e-mail: 
>
-- 
Oleg Kalnichevski <[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   

For additional commands, e-mail: 





Re: Question about parsing of ambiguous URIs

2003-01-25 Thread Michael Becke
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:   

For additional commands, e-mail: 




--
To unsubscribe, e-mail:   
For additional commands, e-mail: