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: URI class with userinfo ?
Date Thu, 10 Jul 2003 13:46:06 GMT
Yes, it seems that none of the methods for getting the full URI include 
the userinfo.  It is intenionaly removed in setURI():

if (_authority != null) { // has_authority
     if (_userinfo != null) { // by default, remove userinfo part
         if (_host != null) {
             buf.append(_host);
             if (_port != -1) {
                 buf.append(':');
                 buf.append(_port);
             }
         }
     } else {
         buf.append(_authority);
     }
}

Why is this the case?  I have no idea.  Anyone else has some thoughts on 
this one?

The only workaround at this point is to build the URI string manually 
from all of the constituent pieces, much like setURI() does.

Mike

Marcus Crafter wrote:
> Hi All,
> 
> Hope all is well!
> 
> If I put the following text into the URI class:
> 
> ftp://anonymous:guest@localhost/incoming/
> 
> Is it possible to get that text back out of the URI class via one of the
> get* methods, or similar ?
> 
> From what I can see, all return the URI excluding the user info, but I need
> in my application I need to get the original string back to pass to the 
> Avalon SourceResolver library.
> 
> I guess there must be some way to extract the original string ? Have I missed 
> something somewhere ?
> 
> Cheers,
> 
> Marcus
> 


Mime
View raw message