commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory" <ggreg...@seagullsw.com>
Subject RE: [VFS] Crashing when trying to set username
Date Mon, 03 May 2004 21:35:42 GMT
Here is what I suggest for getting better feedback from this list:

- Use a current build, and refer to it by it's date in communications.
- Provide the stack trace

Even better: create a Bugzilla ticket with above info on how to
reproduce.

Thank you,
Gary 

> -----Original Message-----
> From: Adam R. B. Jack [mailto:ajack@trysybase.com]
> Sent: Monday, May 03, 2004 13:12
> To: commons-user@jakarta.apache.org
> Subject: [VFS] Crashing when trying to set username
> 
> When I run some VFS-using code (a few months old) using this code:
> 
> public static FileSystemManager createFSM(String name, String base)
> throws FileSystemException {
>     DefaultFileSystemManager fsm = new StandardFileSystemManager();
>     fsm.init();
>     // Set Base Directory for Resolving Relative To...
>     fsm.setBaseFile(new java.io.File(base));
>     return fsm;
> }
> 
> it crashes in this code (saying you can't pass a null username) at
this
> point:
> 
> /**
> * Returns the client for this file system.
> */
> protected HttpClient getClient()
> throws FileSystemException
> {
>     if (client == null)
>     {
>     // Create an Http client
>     final GenericFileName rootName = (GenericFileName) getRootName();
>     client = new HttpClient(new MultiThreadedHttpConnectionManager());
>     final HostConfiguration config = new HostConfiguration();
>     config.setHost(rootName.getHostName(), rootName.getPort());
>     client.setHostConfiguration(config);
>     final UsernamePasswordCredentials creds =
>     new UsernamePasswordCredentials(rootName.getUserName(),
> rootName.getPassword    ());
>     client.getState().setCredentials(null, rootName.getHostName(),
creds);
>     }
>     return client;
> }
> 
> Any pointers on how I get past this? It would seem that somehow I need
to
> set a username on that rootName, but I'm not sure how.
> 
> Thanks in advance,
> 
> regards,
> 
> Adam
> --
> Experience the Unwired Enterprise:
> http://www.sybase.com/unwiredenterprise
> Try Sybase: http://www.try.sybase.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message