be more forceful on the no-cache

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163958 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-04-15 12:35:21 +00:00
parent d3c5de773f
commit e2c9a495e7
1 changed files with 6 additions and 8 deletions

View File

@ -67,8 +67,7 @@ public class HttpUtils
{
protected PasswordAuthentication getPasswordAuthentication()
{
return new PasswordAuthentication( proxyUserName,
proxyPassword == null
return new PasswordAuthentication( proxyUserName, proxyPassword == null
? new char[0] : proxyPassword.toCharArray() );
}
} );
@ -210,7 +209,7 @@ public class HttpUtils
connection.setRequestProperty( "Authorization", "Basic " + encoding );
}
connection.setUseCaches( false );
connection.setRequestProperty( "Pragma", "no-cache" );
//connect to the remote site (may take some time)
connection.connect();
@ -223,10 +222,9 @@ public class HttpUtils
// test for 404 ourselves, and throw FileNotFoundException as needed
if ( httpConnection.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND )
{
throw new FileNotFoundException(
url.toString() + " (HTTP Error: " + httpConnection.getResponseCode() + " " +
httpConnection.getResponseMessage() +
")" );
throw new FileNotFoundException( url.toString() + " (HTTP Error: " + httpConnection.getResponseCode() +
" " +
httpConnection.getResponseMessage() + ")" );
}
if ( httpConnection.getResponseCode() == HttpURLConnection.HTTP_NOT_MODIFIED )
{