From 9c9178d60fd576ffa302e2d565fdb8b9ed73b7a4 Mon Sep 17 00:00:00 2001 From: "Edwin L. Punzalan" Date: Thu, 9 Feb 2006 03:21:27 +0000 Subject: [PATCH] MRM-43 Applied code formatting git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@376170 13f79535-47bb-0310-9956-ffa450edef68 --- .../repository/proxy/DefaultProxyManager.java | 39 ++++++++++--------- .../maven/repository/proxy/ProxyManager.java | 12 +++--- .../repository/proxy/ProxyManagerFactory.java | 9 ++--- .../configuration/ProxyConfiguration.java | 9 +++-- .../proxy/DefaultProxyManagerTest.java | 8 ++-- .../configuration/ProxyConfigurationTest.java | 2 +- 6 files changed, 41 insertions(+), 38 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 0d226f3eb..bda66cfdd 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 @@ -33,8 +33,8 @@ 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.IOUtil; import org.codehaus.plexus.util.FileUtils; +import org.codehaus.plexus.util.IOUtil; import java.io.File; import java.io.FileInputStream; @@ -126,9 +126,9 @@ public class DefaultProxyManager * * @param artifact the artifact object to be downloaded from a remote repository * @return File object representing the remote artifact in the repository cache - * @throws ProxyException when an error occurred during retrieval of the requested artifact + * @throws ProxyException when an error occurred during retrieval of the requested artifact * @throws ResourceDoesNotExistException when the requested artifact cannot be found in any of the - * configured repositories + * configured repositories */ private File getArtifactFile( Artifact artifact ) throws ResourceDoesNotExistException, ProxyException @@ -156,13 +156,13 @@ public class DefaultProxyManager /** * Used to retrieve a remote file from the remote repositories. This method is used only when the requested - * path cannot be resolved into a repository object, for example, an Artifact. + * path cannot be resolved into a repository object, for example, an Artifact. * * @param path the remote path to use to search for the requested file * @return File object representing the remote file in the repository cache * @throws ResourceDoesNotExistException when the requested path cannot be found in any of the configured - * repositories. - * @throws ProxyException when an error occurred during the retrieval of the requested path + * repositories. + * @throws ProxyException when an error occurred during the retrieval of the requested path */ private File getRepositoryFile( String path ) throws ResourceDoesNotExistException, ProxyException @@ -172,14 +172,14 @@ public class DefaultProxyManager /** * Used to retrieve a remote file from the remote repositories. This method is used only when the requested - * path cannot be resolved into a repository object, for example, an Artifact. + * path cannot be resolved into a repository object, for example, an Artifact. * - * @param path the remote path to use to search for the requested file + * @param path the remote path to use to search for the requested file * @param useChecksum forces the download to whether use a checksum (if present in the remote repository) or not * @return File object representing the remote file in the repository cache * @throws ResourceDoesNotExistException when the requested path cannot be found in any of the configured - * repositories. - * @throws ProxyException when an error occurred during the retrieval of the requested path + * repositories. + * @throws ProxyException when an error occurred during the retrieval of the requested path */ private File getRepositoryFile( String path, boolean useChecksum ) throws ResourceDoesNotExistException, ProxyException @@ -218,7 +218,7 @@ public class DefaultProxyManager { tries++; - getLogger().info( "Trying " + path + " from " + repository.getId() + "..."); + getLogger().info( "Trying " + path + " from " + repository.getId() + "..." ); wagon.get( path, temp ); @@ -307,7 +307,7 @@ public class DefaultProxyManager /** * Used to remove the ChecksumObservers from the wagonManager object * - * @param wagon the wagonManager object to remote the ChecksumObservers from + * @param wagon the wagonManager object to remote the ChecksumObservers from * @param checksumMap the map representing the list of ChecksumObservers added to the wagonManager object */ private void releaseChecksums( Wagon wagon, Map checksumMap ) @@ -322,7 +322,7 @@ public class DefaultProxyManager /** * Used to request the wagonManager object to connect to a repository * - * @param wagon the wagonManager object that will be used to connect to the repository + * @param wagon the wagonManager object that will be used to connect to the repository * @param repository the repository object to connect the wagonManager to * @return true when the wagonManager is able to connect to the repository */ @@ -350,8 +350,8 @@ public class DefaultProxyManager * Used to verify the checksum during a wagonManager download * * @param checksumMap the map of ChecksumObservers present in the wagonManager as transferlisteners - * @param path path of the remote object whose checksum is to be verified - * @param wagon the wagonManager object used to download the requested path + * @param path path of the remote object whose checksum is to be verified + * @param wagon the wagonManager object used to download the requested path * @return true when the checksum succeeds and false when the checksum failed. */ private boolean doChecksumCheck( Map checksumMap, String path, Wagon wagon ) @@ -392,17 +392,20 @@ public class DefaultProxyManager } catch ( TransferFailedException e ) { - getLogger().debug( "An error occurred during the download of " + checksumPath + ": " + e.getMessage(), e ); + getLogger().debug( "An error occurred during the download of " + checksumPath + ": " + e.getMessage(), + e ); // do nothing try the next checksum } catch ( ResourceDoesNotExistException e ) { - getLogger().debug( "An error occurred during the download of " + checksumPath + ": " + e.getMessage(), e ); + getLogger().debug( "An error occurred during the download of " + checksumPath + ": " + e.getMessage(), + e ); // do nothing try the next checksum } catch ( AuthorizationException e ) { - getLogger().debug( "An error occurred during the download of " + checksumPath + ": " + e.getMessage(), e ); + getLogger().debug( "An error occurred during the download of " + checksumPath + ": " + e.getMessage(), + e ); // do nothing try the next checksum } catch ( IOException e ) diff --git a/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/ProxyManager.java b/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/ProxyManager.java index b70d5af0b..bd9838022 100644 --- a/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/ProxyManager.java +++ b/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/ProxyManager.java @@ -16,8 +16,8 @@ package org.apache.maven.repository.proxy; * limitations under the License. */ -import org.apache.maven.wagon.ResourceDoesNotExistException; import org.apache.maven.repository.proxy.configuration.ProxyConfiguration; +import org.apache.maven.wagon.ResourceDoesNotExistException; import java.io.File; @@ -35,22 +35,22 @@ public interface ProxyManager * * @param path the expected repository path * @return File object referencing the requested path in the cache - * @throws ProxyException when an exception occurred during the retrieval of the requested path + * @throws ProxyException when an exception occurred during the retrieval of the requested path * @throws ResourceDoesNotExistException when the requested object can't be found in any of the - * configured repositories + * configured repositories */ File get( String path ) throws ProxyException, ResourceDoesNotExistException; /** * Used to force remote download of the requested path from any the configured repositories. This method will - * only bypass the cache for searching but the requested path will still be cached. + * only bypass the cache for searching but the requested path will still be cached. * * @param path the expected repository path * @return File object referencing the requested path in the cache - * @throws ProxyException when an exception occurred during the retrieval of the requested path + * @throws ProxyException when an exception occurred during the retrieval of the requested path * @throws ResourceDoesNotExistException when the requested object can't be found in any of the - * configured repositories + * configured repositories */ File getRemoteFile( String path ) throws ProxyException, ResourceDoesNotExistException; diff --git a/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/ProxyManagerFactory.java b/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/ProxyManagerFactory.java index 04b45cc5d..5710500ff 100644 --- a/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/ProxyManagerFactory.java +++ b/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/ProxyManagerFactory.java @@ -17,16 +17,15 @@ package org.apache.maven.repository.proxy; */ import org.apache.maven.repository.proxy.configuration.ProxyConfiguration; -import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable; -import org.codehaus.plexus.context.Context; -import org.codehaus.plexus.context.ContextException; -import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.PlexusConstants; +import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; +import org.codehaus.plexus.context.Context; +import org.codehaus.plexus.context.ContextException; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable; /** * @author Edwin Punzalan - * * @plexus.component role="org.apache.maven.repository.proxy.ProxyManagerFactory" */ public class ProxyManagerFactory diff --git a/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/configuration/ProxyConfiguration.java b/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/configuration/ProxyConfiguration.java index 55f78435b..0d5732a9a 100644 --- a/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/configuration/ProxyConfiguration.java +++ b/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/configuration/ProxyConfiguration.java @@ -23,10 +23,10 @@ import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; import org.apache.maven.repository.proxy.repository.ProxyRepository; +import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.io.File; /** * Class to represent the configuration file for the proxy @@ -46,6 +46,7 @@ public class ProxyConfiguration private boolean browsable; private ArtifactRepository repoCache; + private List repositories = new ArrayList(); /** @@ -81,9 +82,9 @@ public class ProxyConfiguration ArtifactRepositoryLayout layout = new DefaultRepositoryLayout(); - repoCache = artifactRepositoryFactory.createArtifactRepository( "localCache", "file://" + - new File( path ).getAbsolutePath(), layout, - standardPolicy, standardPolicy ); + repoCache = artifactRepositoryFactory.createArtifactRepository( "localCache", + "file://" + new File( path ).getAbsolutePath(), + layout, standardPolicy, standardPolicy ); } /** diff --git a/maven-repository-proxy/src/test/java/org/apache/maven/repository/proxy/DefaultProxyManagerTest.java b/maven-repository-proxy/src/test/java/org/apache/maven/repository/proxy/DefaultProxyManagerTest.java index d9faab189..0b0824ae9 100644 --- a/maven-repository-proxy/src/test/java/org/apache/maven/repository/proxy/DefaultProxyManagerTest.java +++ b/maven-repository-proxy/src/test/java/org/apache/maven/repository/proxy/DefaultProxyManagerTest.java @@ -1,12 +1,12 @@ package org.apache.maven.repository.proxy; -import org.codehaus.plexus.PlexusTestCase; -import org.codehaus.plexus.component.repository.exception.ComponentLookupException; +import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; +import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; import org.apache.maven.repository.proxy.configuration.ProxyConfiguration; import org.apache.maven.repository.proxy.repository.ProxyRepository; import org.apache.maven.wagon.ResourceDoesNotExistException; -import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; -import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; +import org.codehaus.plexus.PlexusTestCase; +import org.codehaus.plexus.component.repository.exception.ComponentLookupException; import java.io.File; diff --git a/maven-repository-proxy/src/test/java/org/apache/maven/repository/proxy/configuration/ProxyConfigurationTest.java b/maven-repository-proxy/src/test/java/org/apache/maven/repository/proxy/configuration/ProxyConfigurationTest.java index 43ac0e696..65082a0e3 100644 --- a/maven-repository-proxy/src/test/java/org/apache/maven/repository/proxy/configuration/ProxyConfigurationTest.java +++ b/maven-repository-proxy/src/test/java/org/apache/maven/repository/proxy/configuration/ProxyConfigurationTest.java @@ -24,8 +24,8 @@ import org.apache.maven.repository.proxy.repository.ProxyRepository; import org.codehaus.plexus.PlexusTestCase; import java.io.File; -import java.util.List; import java.util.ArrayList; +import java.util.List; public class ProxyConfigurationTest extends PlexusTestCase -- 2.39.5