@Override
protected FileSystem doCreateFileSystem(final FileName name, final FileSystemOptions fileSystemOptions)
throws FileSystemException
{
// Create the file system
final GenericFileName rootName = (GenericFileName) name;
FileSystemOptions fsOpts = (fileSystemOptions == null) ? new FileSystemOptions() : fileSystemOptions;
UserAuthenticationData authData = null;
HttpClient httpClient;
try
{
authData = UserAuthenticatorUtils.authenticate(fsOpts, AUTHENTICATOR_TYPES);
httpClient = HttpClientFactory.createConnection(
WebdavFileSystemConfigBuilder.getInstance(),
"http",
rootName.getHostName(),
rootName.getPort(),
UserAuthenticatorUtils.toString(UserAuthenticatorUtils.getData(authData,
UserAuthenticationData.USERNAME, UserAuthenticatorUtils.toChar(rootName.getUserName()))),
UserAuthenticatorUtils.toString(UserAuthenticatorUtils.getData(authData,
UserAuthenticationData.PASSWORD, UserAuthenticatorUtils.toChar(rootName.getPassword()))),
fsOpts);
}
finally
{
UserAuthenticatorUtils.cleanup(authData);