]> source.dussan.org Git - archiva.git/commitdiff
copyright and reformat
authorBrett Porter <brett@apache.org>
Tue, 31 Jan 2006 03:44:13 +0000 (03:44 +0000)
committerBrett Porter <brett@apache.org>
Tue, 31 Jan 2006 03:44:13 +0000 (03:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@373689 13f79535-47bb-0310-9956-ffa450edef68

maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/DefaultProxyManager.java
maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/ProxyException.java
maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/ProxyManager.java
maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/configuration/ProxyConfiguration.java
maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/files/Checksum.java
maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/files/DefaultRepositoryFileManager.java
maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/repository/ProxyRepository.java

index b1a6e637c0bc413346983d3eb1f0bf2f00611191..4fe07d8a92307df8585ef408a7a348bb8f00589c 100644 (file)
@@ -1,12 +1,28 @@
 package org.apache.maven.repository.proxy;
 
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.manager.ChecksumFailedException;
 import org.apache.maven.artifact.manager.WagonManager;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.repository.proxy.configuration.ProxyConfiguration;
-import org.apache.maven.repository.proxy.files.DefaultRepositoryFileManager;
 import org.apache.maven.repository.proxy.files.Checksum;
+import org.apache.maven.repository.proxy.files.DefaultRepositoryFileManager;
 import org.apache.maven.repository.proxy.repository.ProxyRepository;
 import org.apache.maven.wagon.ConnectionException;
 import org.apache.maven.wagon.ResourceDoesNotExistException;
@@ -91,11 +107,11 @@ public class DefaultProxyManager
                 }
             }
         }
-        catch( TransferFailedException e )
+        catch ( TransferFailedException e )
         {
             throw new ProxyException( e.getMessage(), e );
         }
-        catch( ResourceDoesNotExistException e)
+        catch ( ResourceDoesNotExistException e )
         {
             throw new ProxyException( e.getMessage(), e );
         }
@@ -129,7 +145,7 @@ public class DefaultProxyManager
         ArtifactRepository cache = config.getRepositoryCache();
         File target = new File( cache.getBasedir(), path );
 
-        for( Iterator repositories = config.getRepositories().iterator(); repositories.hasNext(); )
+        for ( Iterator repositories = config.getRepositories().iterator(); repositories.hasNext(); )
         {
             ProxyRepository repository = (ProxyRepository) repositories.next();
 
@@ -151,8 +167,8 @@ public class DefaultProxyManager
                 }
                 catch ( NoSuchAlgorithmException e )
                 {
-                    System.out.println( "Skipping checksum validation for unsupported algorithm: "
-                        + repository.getChecksum() );
+                    System.out.println(
+                        "Skipping checksum validation for unsupported algorithm: " + repository.getChecksum() );
                 }
 
                 if ( connectToRepository( wagon, repository ) )
@@ -163,7 +179,7 @@ public class DefaultProxyManager
                     int tries = 0;
                     boolean success = false;
 
-                    while( !success )
+                    while ( !success )
                     {
                         tries++;
 
@@ -191,8 +207,7 @@ public class DefaultProxyManager
             }
             catch ( TransferFailedException e )
             {
-                System.out.println( "Skipping repository " + repository.getUrl() +
-                    ": " + e.getMessage() );
+                System.out.println( "Skipping repository " + repository.getUrl() + ": " + e.getMessage() );
             }
             catch ( ResourceDoesNotExistException e )
             {
@@ -200,8 +215,7 @@ public class DefaultProxyManager
             }
             catch ( AuthorizationException e )
             {
-                System.out.println( "Skipping repository " + repository.getUrl() +
-                    ": " + e.getMessage() );
+                System.out.println( "Skipping repository " + repository.getUrl() + ": " + e.getMessage() );
             }
             catch ( UnsupportedProtocolException e )
             {
@@ -234,7 +248,7 @@ public class DefaultProxyManager
     }
 
     private boolean doChecksumCheck( ChecksumObserver listener, ProxyRepository repository, String path, Wagon wagon )
-        //throws ChecksumFailedException
+    //throws ChecksumFailedException
     {
         boolean success = false;
 
@@ -297,7 +311,10 @@ public class DefaultProxyManager
             if ( expectedChecksum.equals( actualChecksum ) )
             {
                 File checksumFile = new File( destination + checksumFileExtension );
-                if ( checksumFile.exists() ) checksumFile.delete();
+                if ( checksumFile.exists() )
+                {
+                    checksumFile.delete();
+                }
                 FileUtils.copyFile( tempChecksumFile, checksumFile );
             }
             else
index 92ac871c439a715f281b4067be1bf27e67f5cae8..cd6ecc323dbd4d4e28e88b60053a8db402b304ee 100644 (file)
@@ -1,5 +1,21 @@
 package org.apache.maven.repository.proxy;
 
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 /**
  * @author Edwin Punzalan
  */
index 3c582aa4cabd905f11656b40e50c8e71af7ecbd4..c3b1d6ca16629fe6f11b151c3a38b8f68ca2ccdd 100644 (file)
@@ -1,12 +1,28 @@
 package org.apache.maven.repository.proxy;
 
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.wagon.ResourceDoesNotExistException;
 import org.apache.maven.wagon.TransferFailedException;
 
+import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.File;
 
 /**
  * @author Edwin Punzalan
@@ -15,6 +31,7 @@ public interface ProxyManager
 {
     File getArtifactFile( Artifact artifact )
         throws TransferFailedException, ResourceDoesNotExistException, IOException;
+
     InputStream getArtifactAsStream( Artifact artifact )
         throws TransferFailedException, ResourceDoesNotExistException, IOException;
 }
index 990e15480ce99fc8d7adb37984a27b30d4064f14..be0555088a161d489db24b55c598b06006983a05 100644 (file)
@@ -1,30 +1,49 @@
 package org.apache.maven.repository.proxy.configuration;
 
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
 import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
+import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
 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.util.ArrayList;
-import java.util.List;
 import java.util.Collections;
+import java.util.List;
 
 /**
- * @plexus.component role="org.apache.maven.repository.proxy.configuration.ProxyConfiguration"
- *
  * @author Edwin Punzalan
+ * @plexus.component role="org.apache.maven.repository.proxy.configuration.ProxyConfiguration"
  */
 public class ProxyConfiguration
 {
     public static final String ROLE = ProxyConfiguration.class.getName();
 
-    /** @plexus.requirement */
+    /**
+     * @plexus.requirement
+     */
     private ArtifactRepositoryFactory artifactRepositoryFactory;
 
     private boolean browsable;
+
     private ArtifactRepository repoCache;
+
     private ArrayList repositories = new ArrayList();
 
     public void setBrowsable( boolean browsable )
@@ -49,7 +68,7 @@ public class ProxyConfiguration
                                                                         standardPolicy, standardPolicy );
     }
 
-    public ArtifactRepository getRepositoryCache( )
+    public ArtifactRepository getRepositoryCache()
     {
         return repoCache;
     }
index 458848899dbf344bf1ffe1243c299c97b4212adb..1b2314f8f6a6e07f732691578838abce5951c86b 100644 (file)
@@ -1,5 +1,21 @@
 package org.apache.maven.repository.proxy.files;
 
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 /**
  * @author Edwin Punzalan
  */
index f3317735ce7b8cd1a7985795a6020044d3086410..2289286ba548ee967a500ccec0aecf9ae3055a82 100644 (file)
@@ -1,5 +1,21 @@
 package org.apache.maven.repository.proxy.files;
 
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
 
@@ -67,7 +83,7 @@ public class DefaultRepositoryFileManager
         List reversedPath = new ArrayList();
 
         StringTokenizer tokenizer = new StringTokenizer( path, "/" );
-        while( tokenizer.hasMoreTokens() )
+        while ( tokenizer.hasMoreTokens() )
         {
             reversedPath.add( 0, tokenizer.nextToken() );
         }
index d0e833952b711753c5e5778b36b7e7cca7af6e1f..fcea3456c8c4019f0db2a260e0ba792e740c6435 100644 (file)
@@ -1,9 +1,25 @@
 package org.apache.maven.repository.proxy.repository;
 
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import org.apache.maven.artifact.repository.DefaultArtifactRepository;
 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
-import org.apache.maven.wagon.observers.ChecksumObserver;
 import org.apache.maven.repository.proxy.files.Checksum;
+import org.apache.maven.wagon.observers.ChecksumObserver;
 
 import java.security.NoSuchAlgorithmException;