private FileSystem createWebFileSystem( final LayeredFileName genericRootName,
final FileSystemOptions fileSystemOptions ) throws FileSystemException {
UserAuthenticationData authData = null;
try {
authData = UserAuthenticatorUtils.authenticate( fileSystemOptions, AUTHENTICATOR_TYPES );
final GenericFileName outerName = (GenericFileName) genericRootName.getOuterName();
final HttpClient httpClient = HttpClientFactory.createConnection(
outerName.getScheme(),
outerName.getHostName(),
outerName.getPort(),
UserAuthenticatorUtils.toString( UserAuthenticatorUtils.getData
( authData, UserAuthenticationData.USERNAME, UserAuthenticatorUtils.toChar( outerName.getUserName() ) ) ),
UserAuthenticatorUtils.toString( UserAuthenticatorUtils.getData
( authData, UserAuthenticationData.PASSWORD, UserAuthenticatorUtils.toChar( outerName.getPassword() ) ) ),
fileSystemOptions
);
httpClient.getParams().setAuthenticationPreemptive( true );
final PentahoSolutionsFileSystemConfigBuilder configBuilder = new PentahoSolutionsFileSystemConfigBuilder();
final int timeOut = configBuilder.getTimeOut( fileSystemOptions );
httpClient.getParams().setSoTimeout( Math.max( 0, timeOut ) );
return new WebSolutionFileSystem( genericRootName, fileSystemOptions,
new LocalFileModel( outerName.getURI(), httpClient,
outerName.getUserName(), outerName.getPassword() )
);
} finally {
UserAuthenticatorUtils.cleanup( authData );
}
}