brett 2005/04/15 05:35:21
Modified: maven-mboot2/src/main/java/download HttpUtils.java Log: be more forceful on the no-cache Revision Changes Path 1.4 +6 -8 maven-components/maven-mboot2/src/main/java/download/HttpUtils.java Index: HttpUtils.java =================================================================== RCS file: /home/cvs/maven-components/maven-mboot2/src/main/java/download/HttpUtils.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- HttpUtils.java 15 Apr 2005 12:06:11 -0000 1.3 +++ HttpUtils.java 15 Apr 2005 12:35:21 -0000 1.4 @@ -67,9 +67,8 @@ { 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 @@ 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 @@ // 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 ) {