From: Brett Porter Date: Tue, 17 Mar 2009 16:58:49 +0000 (+0000) Subject: clean up warnings in webdav module X-Git-Tag: archiva-1.2~37 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f8373b46e0beaa9cc341cb5c03728fd71694e849;p=archiva.git clean up warnings in webdav module git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@755319 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavLocatorFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavLocatorFactory.java index 0529b7205..d67c4763a 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavLocatorFactory.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavLocatorFactory.java @@ -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; /** diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java index 16279f3e2..201bb828d 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java @@ -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 ) diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSession.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSession.java index 95d75805c..0e85a3eea 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSession.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSession.java @@ -24,7 +24,7 @@ import org.apache.jackrabbit.webdav.DavSession; public class ArchivaDavSession implements DavSession { - private final HashSet lockTokens = new HashSet(); + private final HashSet lockTokens = new HashSet(); public void addLockToken(String token) { diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProvider.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProvider.java index bb1c6d67a..6157f1cb8 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProvider.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProvider.java @@ -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 ) diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaVirtualDavResource.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaVirtualDavResource.java index 8b6befb0b..4bb3a140a 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaVirtualDavResource.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaVirtualDavResource.java @@ -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 { diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/IndexWriter.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/IndexWriter.java index e02923590..25e995532 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/IndexWriter.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/IndexWriter.java @@ -37,8 +37,6 @@ import java.io.File; */ public class IndexWriter { - private final DavResource resource; - private final String logicalResource; private final List localResources; @@ -47,7 +45,6 @@ public class IndexWriter public IndexWriter(DavResource resource, File localResource, String logicalResource) { - this.resource = resource; this.localResources = new ArrayList(); this.localResources.add( localResource ); this.logicalResource = logicalResource; @@ -56,7 +53,6 @@ public class IndexWriter public IndexWriter( DavResource resource, List localResources, String logicalResource ) { - this.resource = resource; this.logicalResource = logicalResource; this.localResources = localResources; this.isVirtual = true; diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/MimeTypes.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/MimeTypes.java index 731019cb3..d1fb7b97f 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/MimeTypes.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/MimeTypes.java @@ -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 mimeMap = new HashMap(); private Logger log = LoggerFactory.getLogger( MimeTypes.class ); diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/WebdavMethodUtil.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/WebdavMethodUtil.java index b103e87b4..9d488f7b6 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/WebdavMethodUtil.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/WebdavMethodUtil.java @@ -31,11 +31,11 @@ import java.util.List; */ public class WebdavMethodUtil { - private static final List READ_METHODS; + private static final List READ_METHODS; static { - READ_METHODS = new ArrayList(); + READ_METHODS = new ArrayList(); READ_METHODS.add( "HEAD" ); READ_METHODS.add( "GET" ); READ_METHODS.add( "PROPFIND" ); diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProviderTest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProviderTest.java index 20a8543f9..370b30ff6 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProviderTest.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProviderTest.java @@ -85,6 +85,7 @@ public class ArchivaDavSessionProviderTest extends TestCase assertNull(request.getDavSession()); } + @SuppressWarnings("unchecked") private class HttpServletRequestMock implements HttpServletRequest { public Object getAttribute(String arg0) { diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java index 511cbeb12..74cefed44 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java @@ -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.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.emptyList(), consumers ); } } } diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedMetadataRemoteOnlyTest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedMetadataRemoteOnlyTest.java index ab6428654..2463e3aea 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedMetadataRemoteOnlyTest.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedMetadataRemoteOnlyTest.java @@ -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 ); diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/httpunit/MkColMethodWebRequest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/httpunit/MkColMethodWebRequest.java index a473dfe52..f9c158dba 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/httpunit/MkColMethodWebRequest.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/httpunit/MkColMethodWebRequest.java @@ -20,7 +20,6 @@ package org.apache.maven.archiva.webdav.httpunit; */ import com.meterware.httpunit.HeaderOnlyWebRequest; -import java.net.URL; /** * MkColMethodWebRequest