commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam R. B. Jack" <aj...@trysybase.com>
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();
    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


Mime
View raw message