Author: sebb
Date: Sun Nov 7 23:39:11 2010
New Revision: 1032421
URL: http://svn.apache.org/viewvc?rev=1032421&view=rev
Log:
Replace deprecated methods with updated ones
Modified:
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpClientFactory.java
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpFileContentInfoFactory.java
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpFileObject.java
Modified:
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpClientFactory.java
URL:
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpClientFactory.java?rev=1032421&r1=1032420&r2=1032421&view=diff
==============================================================================
---
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpClientFactory.java
(original)
+++
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpClientFactory.java
Sun Nov 7 23:39:11 2010
@@ -24,6 +24,7 @@ import org.apache.commons.httpclient.Htt
import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
import org.apache.commons.httpclient.params.HttpClientParams;
+import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.commons.httpclient.methods.HeadMethod;
import org.apache.commons.vfs.FileSystemException;
import org.apache.commons.vfs.FileSystemOptions;
@@ -108,7 +109,8 @@ public final class HttpClientFactory
UserAuthenticatorUtils.toString(UserAuthenticatorUtils.getData(authData,
UserAuthenticationData.PASSWORD, null)));
- client.getState().setProxyCredentials(null, proxyHost,
proxyCreds);
+ AuthScope scope = new AuthScope(proxyHost,
AuthScope.ANY_PORT);
+ client.getState().setProxyCredentials(scope,
proxyCreds);
}
if (builder.isPreemptiveAuth(fileSystemOptions)) {
@@ -138,7 +140,8 @@ public final class HttpClientFactory
{
final UsernamePasswordCredentials creds =
new UsernamePasswordCredentials(username, password);
- client.getState().setCredentials(null, hostname, creds);
+ AuthScope scope = new AuthScope(hostname, AuthScope.ANY_PORT);
+ client.getState().setCredentials(scope, creds);
}
client.executeMethod(new HeadMethod());
Modified:
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpFileContentInfoFactory.java
URL:
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpFileContentInfoFactory.java?rev=1032421&r1=1032420&r2=1032421&view=diff
==============================================================================
---
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpFileContentInfoFactory.java
(original)
+++
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpFileContentInfoFactory.java
Sun Nov 7 23:39:11 2010
@@ -18,7 +18,6 @@ package org.apache.commons.vfs.provider.
import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.HeaderElement;
-import org.apache.commons.httpclient.HttpException;
import org.apache.commons.vfs.FileContent;
import org.apache.commons.vfs.FileContentInfo;
import org.apache.commons.vfs.FileContentInfoFactory;
@@ -45,15 +44,7 @@ public class HttpFileContentInfoFactory
Header header =
httpFile.getHeadMethod().getResponseHeader("content-type");
if (header != null)
{
- HeaderElement[] element;
- try
- {
- element = header.getValues();
- }
- catch (HttpException e)
- {
- throw new FileSystemException(e);
- }
+ HeaderElement[] element = header.getElements();
if (element != null && element.length > 0)
{
contentType = element[0].getName();
Modified:
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpFileObject.java
URL:
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpFileObject.java?rev=1032421&r1=1032420&r2=1032421&view=diff
==============================================================================
---
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpFileObject.java
(original)
+++
commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpFileObject.java
Sun Nov 7 23:39:11 2010
@@ -22,7 +22,7 @@ import org.apache.commons.httpclient.Htt
import org.apache.commons.httpclient.URIException;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.HeadMethod;
-import org.apache.commons.httpclient.util.DateParser;
+import org.apache.commons.httpclient.util.DateUtil;
import org.apache.commons.httpclient.util.URIUtil;
import org.apache.commons.vfs.provider.AbstractFileObject;
@@ -141,7 +141,7 @@ public class HttpFileObject
{
throw new
FileSystemException("vfs.provider.http/last-modified.error", getName());
}
- return DateParser.parseDate(header.getValue()).getTime();
+ return DateUtil.parseDate(header.getValue()).getTime();
}
/**