hostname,
port,
"/");
// WebdavResource resource = null;
WebdavResource resource = new WebdavResource()
{
};
if (fileSystemOptions != null)
{
String proxyHost = WebdavFileSystemConfigBuilder.getInstance().getProxyHost(fileSystemOptions);
int proxyPort = WebdavFileSystemConfigBuilder.getInstance().getProxyPort(fileSystemOptions);
if (proxyHost != null && proxyPort > 0)
{
// resource = new WebdavResource(url, proxyHost, proxyPort);
resource.setProxy(proxyHost, proxyPort);
}
UserAuthenticator proxyAuth = WebdavFileSystemConfigBuilder.getInstance().getProxyAuthenticator(fileSystemOptions);
if (proxyAuth != null)
{
UserAuthenticationData authData = UserAuthenticatorUtils.authenticate(proxyAuth, new UserAuthenticationData.Type[]
{
UserAuthenticationData.USERNAME,
UserAuthenticationData.PASSWORD
});
if (authData != null)
{
final UsernamePasswordCredentials proxyCreds =
new UsernamePasswordCredentials(
UserAuthenticatorUtils.toString(UserAuthenticatorUtils.getData(authData, UserAuthenticationData.USERNAME, null)),
UserAuthenticatorUtils.toString(UserAuthenticatorUtils.getData(authData, UserAuthenticationData.PASSWORD, null)));
resource.setProxyCredentials(proxyCreds);
}
}
}
/*
if (resource == null)
{
resource = new WebdavResource(url);
}
resource.setProperties(WebdavResource.NOACTION, 1);
*/
resource.setHttpURL(url, WebdavResource.NOACTION, 1);
client = resource.retrieveSessionInstance();
client.setHttpConnectionManager(new ThreadLocalHttpConnectionManager());
}
catch (final IOException e)
{
throw new FileSystemException("vfs.provider.webdav/connect.error", hostname, e);