]> source.dussan.org Git - archiva.git/commitdiff
clean up warnings in webdav module
authorBrett Porter <brett@apache.org>
Tue, 17 Mar 2009 16:58:49 +0000 (16:58 +0000)
committerBrett Porter <brett@apache.org>
Tue, 17 Mar 2009 16:58:49 +0000 (16:58 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@755319 13f79535-47bb-0310-9956-ffa450edef68

12 files changed:
archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavLocatorFactory.java
archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java
archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSession.java
archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProvider.java
archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaVirtualDavResource.java
archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/IndexWriter.java
archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/MimeTypes.java
archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/WebdavMethodUtil.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProviderTest.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedMetadataRemoteOnlyTest.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/httpunit/MkColMethodWebRequest.java

index 0529b72052a6c56746136653731508dcb921c888..d67c4763a43bd3cdbfb63d0a56910dc219547d67 100644 (file)
@@ -19,11 +19,9 @@ package org.apache.maven.archiva.webdav;
  * under the License.
  */
 
+import org.apache.jackrabbit.util.Text;
 import org.apache.jackrabbit.webdav.DavLocatorFactory;
 import org.apache.jackrabbit.webdav.DavResourceLocator;
-import org.apache.jackrabbit.util.Text;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.ArrayUtils;
 import org.apache.maven.archiva.webdav.util.RepositoryPathUtil;
 
 /**
index 16279f3e2e2e6b55aa78e74679833dd3aeb97bfe..201bb828d04b8593dfbb4caeee3676502bc51f1c 100644 (file)
@@ -44,7 +44,6 @@ import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.RepositoryGroupConfiguration;
 import org.apache.maven.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.maven.archiva.model.ArtifactReference;
-import org.apache.maven.archiva.model.VersionedReference;
 import org.apache.maven.archiva.policies.ProxyDownloadException;
 import org.apache.maven.archiva.proxy.RepositoryProxyConnectors;
 import org.apache.maven.archiva.repository.ManagedRepositoryContent;
@@ -80,7 +79,6 @@ import org.codehaus.plexus.redback.authorization.UnauthorizedException;
 import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
 import org.codehaus.plexus.redback.system.SecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySystemConstants;
 import org.codehaus.plexus.redback.users.User;
 import org.codehaus.plexus.redback.users.UserManager;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
@@ -986,7 +984,7 @@ public class ArchivaDavResourceFactory
     {  
        try
        {           
-           VersionedReference versionRef = metadataTools.toVersionedReference( requestedResource );           
+           metadataTools.toVersionedReference( requestedResource );           
            return false;
        }
        catch ( RepositoryMetadataException re )
index 95d75805c5cf413f0310d033eaeb11290e79e766..0e85a3eea076b947b6c4f2c941a428e6f02c1673 100644 (file)
@@ -24,7 +24,7 @@ import org.apache.jackrabbit.webdav.DavSession;
 
 public class ArchivaDavSession implements DavSession
 {
-    private final HashSet lockTokens = new HashSet();
+    private final HashSet<String> lockTokens = new HashSet<String>();
 
     public void addLockToken(String token) 
     {
index bb1c6d67a86cf6bc4811df11463ad6d44e9f8003..6157f1cb80b0b67d75045cfa007d8a27877952e5 100644 (file)
@@ -34,27 +34,20 @@ import org.codehaus.plexus.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.policy.MustChangePasswordException;
 import org.codehaus.plexus.redback.users.UserManager;
 import org.codehaus.redback.integration.filter.authentication.HttpAuthenticator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  */
 public class ArchivaDavSessionProvider
     implements DavSessionProvider
 {
-    private Logger log = LoggerFactory.getLogger( ArchivaDavSessionProvider.class );
-
     private ServletAuthenticator servletAuth;
 
     private HttpAuthenticator httpAuth;
     
-    private ArchivaXworkUser archivaXworkUser;
-    
     public ArchivaDavSessionProvider( ServletAuthenticator servletAuth, HttpAuthenticator httpAuth, ArchivaXworkUser archivaXworkUser )
     {
         this.servletAuth = servletAuth;
         this.httpAuth = httpAuth;
-        this.archivaXworkUser = archivaXworkUser;
     }
 
     public boolean attachSession( WebdavRequest request )
index 8b6befb0b7a124d1926f9fdac8be29a0e8c9cf96..4bb3a140a05dacb7f90a018647003e09b112f625 100644 (file)
@@ -63,8 +63,6 @@ public class ArchivaVirtualDavResource
     
     private static final String COMPLIANCE_CLASS = "1";
 
-    private MimeTypes mimeTypes;
-
     private ArchivaDavResourceLocator locator;
 
     private DavResourceFactory factory;
@@ -84,7 +82,6 @@ public class ArchivaVirtualDavResource
     {
         this.localResources = localResources;
         this.logicalResource = logicalResource;
-        this.mimeTypes = mimeTypes;
         this.locator = locator;
         this.factory = factory;
         this.properties = new DavPropertySet();
@@ -122,6 +119,7 @@ public class ArchivaVirtualDavResource
         
     }
 
+    @SuppressWarnings("unchecked")
     public MultiStatusResponse alterProperties( List arg0 )
         throws DavException
     {       
index e0292359055ca0da2292b8da41357d9c19f2340f..25e9955322db344c4d73fb50634f1130f16c2c31 100644 (file)
@@ -37,8 +37,6 @@ import java.io.File;
  */
 public class IndexWriter
 {
-    private final DavResource resource;
-
     private final String logicalResource;
     
     private final List<File> localResources;
@@ -47,7 +45,6 @@ public class IndexWriter
     
     public IndexWriter(DavResource resource, File localResource, String logicalResource)
     {
-        this.resource = resource;
         this.localResources = new ArrayList<File>();
         this.localResources.add( localResource );
         this.logicalResource = logicalResource;
@@ -56,7 +53,6 @@ public class IndexWriter
     
     public IndexWriter( DavResource resource, List<File> localResources, String logicalResource )
     {
-        this.resource = resource;
         this.logicalResource = logicalResource;
         this.localResources = localResources;
         this.isVirtual = true;
index 731019cb3e29b66589cc0fd3968f70b499564665..d1fb7b97fc018e742ed2d7f8d1012d884be65d37 100644 (file)
@@ -52,7 +52,7 @@ public class MimeTypes
 
     private String resource = "org/apache/maven/archiva/webdav/util/mime.types";
     
-    private Map mimeMap = new HashMap();
+    private Map<String, String> mimeMap = new HashMap<String, String>();
 
     private Logger log = LoggerFactory.getLogger( MimeTypes.class );
     
index b103e87b456566ea44bdc1698ea1a2e788a8938e..9d488f7b6d61bca1a0fabdbc6cd1936129f7d77d 100644 (file)
@@ -31,11 +31,11 @@ import java.util.List;
  */
 public class WebdavMethodUtil
 {
-    private static final List READ_METHODS;
+    private static final List<String> READ_METHODS;
 
     static
     {
-        READ_METHODS = new ArrayList();
+        READ_METHODS = new ArrayList<String>();
         READ_METHODS.add( "HEAD" );
         READ_METHODS.add( "GET" );
         READ_METHODS.add( "PROPFIND" );
index 20a8543f95728c5e02906142ab26726b525f9153..370b30ff6cfc195ff2759ed2e7a58258307a174d 100644 (file)
@@ -85,6 +85,7 @@ public class ArchivaDavSessionProviderTest extends TestCase
         assertNull(request.getDavSession());
     }
     
+    @SuppressWarnings("unchecked")
     private class HttpServletRequestMock implements HttpServletRequest
     {
         public Object getAttribute(String arg0) {
index 511cbeb12d6362f0eecc4a742d097ebe1741be98..74cefed44f7ae47c78c2b6fdd9ad94f7c048db00 100644 (file)
@@ -20,6 +20,7 @@ package org.apache.maven.archiva.webdav;
  */
 
 import java.io.File;
+import java.util.Collections;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.jackrabbit.webdav.DavException;
@@ -36,13 +37,12 @@ import org.apache.jackrabbit.webdav.lock.Scope;
 import org.apache.jackrabbit.webdav.lock.SimpleLockManager;
 import org.apache.jackrabbit.webdav.lock.Type;
 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.maven.archiva.repository.audit.AuditListener;
 import org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers;
 import org.apache.maven.archiva.webdav.util.MimeTypes;
 import org.codehaus.plexus.spring.PlexusInSpringTestCase;
 import org.codehaus.plexus.spring.PlexusToSpringUtils;
 
-import edu.emory.mathcs.backport.java.util.Collections;
-
 public class DavResourceTest extends PlexusInSpringTestCase
 {
     private DavSession session;
@@ -98,7 +98,7 @@ public class DavResourceTest extends PlexusInSpringTestCase
     private DavResource getDavResource(String logicalPath, File file)
     {
         return new ArchivaDavResource( file.getAbsolutePath(), logicalPath, repository, session, resourceLocator,
-                                       resourceFactory, mimeTypes, Collections.emptyList(), consumers );
+                                       resourceFactory, mimeTypes, Collections.<AuditListener>emptyList(), consumers );
     }
     
     public void testDeleteNonExistantResourceShould404()
@@ -299,7 +299,7 @@ public class DavResourceTest extends PlexusInSpringTestCase
 
         public DavResource createResource(DavResourceLocator locator, DavSession session) throws DavException {
             return new ArchivaDavResource( baseDir.getAbsolutePath(), "/", repository, session, resourceLocator,
-                                           resourceFactory, mimeTypes, Collections.emptyList(), consumers );
+                                           resourceFactory, mimeTypes, Collections.<AuditListener>emptyList(), consumers );
         }
     }
 }
index ab6428654269c8be4540afe4a4370096a07419b9..2463e3aeac9ac47dd5e46a7376a629705cec6f4f 100644 (file)
@@ -19,7 +19,6 @@ package org.apache.maven.archiva.webdav;
  * under the License.
  */
 
-import java.io.File;
 
 /**
  * RepositoryServlet Tests, Proxied, Get of Metadata, exists on remote repository only. 
@@ -45,7 +44,7 @@ public class RepositoryServletProxiedMetadataRemoteOnlyTest
         String expectedMetadata = createVersionMetadata( "org.apache.archiva", "archivatest-maven-plugin",
                                                          version, timestamp, buildNumber, lastUpdated);
 
-        File metadataFile = populateRepo( remoteSnapshots, path, expectedMetadata );
+        populateRepo( remoteSnapshots, path, expectedMetadata );
 
         setupConnector( REPOID_INTERNAL, remoteSnapshots );
         setupConnector( REPOID_INTERNAL, remotePrivateSnapshots );
@@ -74,7 +73,7 @@ public class RepositoryServletProxiedMetadataRemoteOnlyTest
         String expectedMetadata = createVersionMetadata( "org.apache.maven.plugins", "maven-assembly-plugin", version,
                                                          timestamp, buildNumber, lastUpdated );
 
-        File metadataFile = populateRepo( remoteSnapshots, path, expectedMetadata );
+        populateRepo( remoteSnapshots, path, expectedMetadata );
 
         setupConnector( REPOID_INTERNAL, remoteSnapshots );
         setupConnector( REPOID_INTERNAL, remotePrivateSnapshots );
@@ -99,7 +98,7 @@ public class RepositoryServletProxiedMetadataRemoteOnlyTest
         String expectedMetadata = createVersionMetadata( "org.apache.archiva", "archivatest-maven-plugin",
                                                          "4.0-alpha-2" );
 
-        File managedFile = populateRepo( remoteSnapshots, path, expectedMetadata );
+        populateRepo( remoteSnapshots, path, expectedMetadata );
 
         setupConnector( REPOID_INTERNAL, remoteSnapshots );
         setupConnector( REPOID_INTERNAL, remotePrivateSnapshots );
@@ -126,7 +125,7 @@ public class RepositoryServletProxiedMetadataRemoteOnlyTest
         String expectedMetadata = createProjectMetadata( "org.apache.archiva", "archivatest-maven-plugin",
                                                          latest, release, new String[] { "1.0-alpha-4" } );
 
-        File managedFile = populateRepo( remoteSnapshots, path, expectedMetadata );
+        populateRepo( remoteSnapshots, path, expectedMetadata );
 
         setupConnector( REPOID_INTERNAL, remoteSnapshots );
         setupConnector( REPOID_INTERNAL, remotePrivateSnapshots );
@@ -150,7 +149,7 @@ public class RepositoryServletProxiedMetadataRemoteOnlyTest
         String path = "org/apache/archiva/maven-metadata.xml";
         String expectedMetadata = createGroupMetadata( "org.apache.archiva", new String[] { "archivatest-maven-plugin" } );
 
-        File managedFile = populateRepo( remoteSnapshots, path, expectedMetadata );
+        populateRepo( remoteSnapshots, path, expectedMetadata );
 
         setupConnector( REPOID_INTERNAL, remoteSnapshots );
         setupConnector( REPOID_INTERNAL, remotePrivateSnapshots );