From e2c9a495e71f282198c05851ba43b25f42035802 Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Fri, 15 Apr 2005 12:35:21 +0000 Subject: [PATCH] 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 --- maven-mboot2/src/main/java/download/HttpUtils.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/maven-mboot2/src/main/java/download/HttpUtils.java b/maven-mboot2/src/main/java/download/HttpUtils.java index 06750a8f99..ae1667e9c9 100644 --- a/maven-mboot2/src/main/java/download/HttpUtils.java +++ b/maven-mboot2/src/main/java/download/HttpUtils.java @@ -67,9 +67,8 @@ public class HttpUtils { protected PasswordAuthentication getPasswordAuthentication() { - return new PasswordAuthentication( proxyUserName, - proxyPassword == null - ? new char[0] : proxyPassword.toCharArray() ); + 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 ) {