From 5a63d9fc3bc6830d9b88813a90c67941f0b53210 Mon Sep 17 00:00:00 2001 From: "Edwin L. Punzalan" Date: Sat, 4 Feb 2006 02:39:24 +0000 Subject: [PATCH] PR: MRM-43 Removed unused methods/parameters git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@374820 13f79535-47bb-0310-9956-ffa450edef68 --- .../repository/proxy/DefaultProxyManager.java | 62 +------------------ 1 file changed, 2 insertions(+), 60 deletions(-) diff --git a/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/DefaultProxyManager.java b/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/DefaultProxyManager.java index 28a962634..f65df6a9a 100644 --- a/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/DefaultProxyManager.java +++ b/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/DefaultProxyManager.java @@ -35,7 +35,6 @@ import org.apache.maven.wagon.authentication.AuthenticationException; import org.apache.maven.wagon.authorization.AuthorizationException; import org.apache.maven.wagon.observers.ChecksumObserver; import org.codehaus.plexus.logging.AbstractLogEnabled; -import org.codehaus.plexus.util.FileUtils; import java.io.File; import java.io.IOException; @@ -177,7 +176,7 @@ public class DefaultProxyManager if ( useChecksum ) { releaseChecksums( wagon, checksums ); - success = doChecksumCheck( checksums, repository, path, wagon ); + success = doChecksumCheck( checksums, path, wagon ); } else { @@ -266,7 +265,7 @@ public class DefaultProxyManager return connected; } - private boolean doChecksumCheck( Map checksumMap, ProxyRepository repository, String path, Wagon wagon ) + private boolean doChecksumCheck( Map checksumMap, String path, Wagon wagon ) { for ( Iterator checksums = checksumMap.keySet().iterator(); checksums.hasNext(); ) { @@ -334,63 +333,6 @@ public class DefaultProxyManager return true; } - private void verifyChecksum( String actualChecksum, File destination, String remotePath, - String checksumFileExtension, Wagon wagon ) - throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException - { - try - { - File tempDestination = new File( destination.getAbsolutePath() + ".tmp" ); - tempDestination.deleteOnExit(); - - File tempChecksumFile = new File( tempDestination + checksumFileExtension + ".tmp" ); - tempChecksumFile.deleteOnExit(); - - wagon.get( remotePath + checksumFileExtension, tempChecksumFile ); - - String expectedChecksum = FileUtils.fileRead( tempChecksumFile ); - - // remove whitespaces at the end - expectedChecksum = expectedChecksum.trim(); - - // check for 'MD5 (name) = CHECKSUM' - if ( expectedChecksum.startsWith( "MD5" ) ) - { - int lastSpacePos = expectedChecksum.lastIndexOf( ' ' ); - expectedChecksum = expectedChecksum.substring( lastSpacePos + 1 ); - } - else - { - // remove everything after the first space (if available) - int spacePos = expectedChecksum.indexOf( ' ' ); - - if ( spacePos != -1 ) - { - expectedChecksum = expectedChecksum.substring( 0, spacePos ); - } - } - - if ( expectedChecksum.equals( actualChecksum ) ) - { - File checksumFile = new File( destination + checksumFileExtension ); - if ( checksumFile.exists() ) - { - checksumFile.delete(); - } - FileUtils.copyFile( tempChecksumFile, checksumFile ); - } - else - { - throw new ChecksumFailedException( "Checksum failed on download: local = '" + actualChecksum + - "'; remote = '" + expectedChecksum + "'" ); - } - } - catch ( IOException e ) - { - throw new ChecksumFailedException( "Invalid checksum file", e ); - } - } - private void disconnectWagon( Wagon wagon ) { try -- 2.39.5