commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam R. B. Jack" <>
Subject [VFS] Crashing when trying to set username
Date Mon, 03 May 2004 20:12:15 GMT
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();
    // Set Base Directory for Resolving Relative To...
    return fsm;

it crashes in this code (saying you can't pass a null username) at this

* 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());
    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,


Experience the Unwired Enterprise:
Try Sybase:

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

View raw message