diff options
author | Olivier Lamy <olamy@apache.org> | 2011-09-22 22:18:06 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2011-09-22 22:18:06 +0000 |
commit | 0157bc252db87ee0427c182346b60b0eb7b30304 (patch) | |
tree | c47a2868ace2dbe5775e1d13ca5af42b06adbe5c /archiva-modules/archiva-web | |
parent | 98db72a675e2fc4a6c0eccbd17846d26a60fbb0f (diff) | |
download | archiva-0157bc252db87ee0427c182346b60b0eb7b30304.tar.gz archiva-0157bc252db87ee0427c182346b60b0eb7b30304.zip |
as there is String concat use log.isDebugEnabled
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1174420 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web')
3 files changed, 61 insertions, 41 deletions
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResource.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResource.java index 3638c186b..2e19fe699 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResource.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResource.java @@ -25,6 +25,8 @@ import org.apache.archiva.audit.AuditListener; import org.apache.archiva.scheduler.ArchivaTaskScheduler; import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler; import org.apache.archiva.scheduler.repository.RepositoryTask; +import org.apache.archiva.webdav.util.IndexWriter; +import org.apache.archiva.webdav.util.MimeTypes; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.jackrabbit.util.Text; @@ -50,8 +52,6 @@ import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; import org.apache.jackrabbit.webdav.property.DavPropertySet; import org.apache.jackrabbit.webdav.property.DefaultDavProperty; import org.apache.jackrabbit.webdav.property.ResourceType; -import org.apache.archiva.webdav.util.IndexWriter; -import org.apache.archiva.webdav.util.MimeTypes; import org.codehaus.plexus.taskqueue.TaskQueueException; import org.joda.time.DateTime; import org.joda.time.format.DateTimeFormatter; @@ -316,11 +316,12 @@ public class ArchivaDavResource } queueRepositoryTask( localFile ); - - log.debug( - "File '" + resource.getDisplayName() + ( exists ? "' modified " : "' created " ) + "(current user '" - + this.principal + "')" ); - + if ( log.isDebugEnabled() ) + { + log.debug( + "File '" + resource.getDisplayName() + ( exists ? "' modified " : "' created " ) + "(current user '" + + this.principal + "')" ); + } triggerAuditEvent( resource, exists ? AuditEvent.MODIFY_FILE : AuditEvent.CREATE_FILE ); } else if ( !inputContext.hasStream() && isCollection() ) // New directory @@ -399,8 +400,11 @@ public class ArchivaDavResource triggerAuditEvent( member, AuditEvent.REMOVE_FILE ); } - log.debug( ( resource.isDirectory() ? "Directory '" : "File '" ) + member.getDisplayName() - + "' removed (current user '" + this.principal + "')" ); + if ( log.isDebugEnabled() ) + { + log.debug( ( resource.isDirectory() ? "Directory '" : "File '" ) + member.getDisplayName() + + "' removed (current user '" + this.principal + "')" ); + } } catch ( IOException e ) { @@ -451,9 +455,11 @@ public class ArchivaDavResource triggerAuditEvent( remoteAddr, locator.getRepositoryId(), logicalResource, AuditEvent.MOVE_FILE ); } - - log.debug( ( isCollection() ? "Directory '" : "File '" ) + getLocalResource().getName() + "' moved to '" - + destination + "' (current user '" + this.principal + "')" ); + if ( log.isDebugEnabled() ) + { + log.debug( ( isCollection() ? "Directory '" : "File '" ) + getLocalResource().getName() + "' moved to '" + + destination + "' (current user '" + this.principal + "')" ); + } } catch ( IOException e ) { @@ -489,8 +495,12 @@ public class ArchivaDavResource triggerAuditEvent( remoteAddr, locator.getRepositoryId(), logicalResource, AuditEvent.COPY_FILE ); } - log.debug( ( isCollection() ? "Directory '" : "File '" ) + getLocalResource().getName() + "' copied to '" - + destination + "' (current user '" + this.principal + "')" ); + if ( log.isDebugEnabled() ) + { + log.debug( + ( isCollection() ? "Directory '" : "File '" ) + getLocalResource().getName() + "' copied to '" + + destination + "' (current user '" + this.principal + "')" ); + } } catch ( IOException e ) { diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java index f40c647cb..fa59079bf 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java @@ -24,19 +24,6 @@ import org.apache.archiva.audit.AuditListener; import org.apache.archiva.audit.Auditable; import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException; -import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler; -import org.apache.archiva.security.ServletAuthenticator; -import org.apache.commons.io.FileUtils; -import org.apache.commons.lang.StringUtils; -import org.apache.jackrabbit.webdav.DavException; -import org.apache.jackrabbit.webdav.DavResource; -import org.apache.jackrabbit.webdav.DavResourceFactory; -import org.apache.jackrabbit.webdav.DavResourceLocator; -import org.apache.jackrabbit.webdav.DavServletRequest; -import org.apache.jackrabbit.webdav.DavServletResponse; -import org.apache.jackrabbit.webdav.DavSession; -import org.apache.jackrabbit.webdav.lock.LockManager; -import org.apache.jackrabbit.webdav.lock.SimpleLockManager; import org.apache.archiva.common.utils.PathUtil; import org.apache.archiva.common.utils.VersionUtil; import org.apache.archiva.configuration.ArchivaConfiguration; @@ -57,9 +44,22 @@ import org.apache.archiva.repository.metadata.RepositoryMetadataException; import org.apache.archiva.repository.metadata.RepositoryMetadataMerge; import org.apache.archiva.repository.metadata.RepositoryMetadataReader; import org.apache.archiva.repository.metadata.RepositoryMetadataWriter; +import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler; +import org.apache.archiva.security.ServletAuthenticator; import org.apache.archiva.webdav.util.MimeTypes; import org.apache.archiva.webdav.util.RepositoryPathUtil; import org.apache.archiva.webdav.util.WebdavMethodUtil; +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.jackrabbit.webdav.DavException; +import org.apache.jackrabbit.webdav.DavResource; +import org.apache.jackrabbit.webdav.DavResourceFactory; +import org.apache.jackrabbit.webdav.DavResourceLocator; +import org.apache.jackrabbit.webdav.DavServletRequest; +import org.apache.jackrabbit.webdav.DavServletResponse; +import org.apache.jackrabbit.webdav.DavSession; +import org.apache.jackrabbit.webdav.lock.LockManager; +import org.apache.jackrabbit.webdav.lock.SimpleLockManager; import org.apache.maven.model.DistributionManagement; import org.apache.maven.model.Model; import org.apache.maven.model.Relocation; @@ -510,9 +510,12 @@ public class ArchivaDavResourceFactory String event = ( previouslyExisted ? AuditEvent.MODIFY_FILE : AuditEvent.CREATE_FILE ) + PROXIED_SUFFIX; - log.debug( "Proxied artifact '" + resourceFile.getName() + "' in repository '" - + managedRepository.getId() + "' (current user '" + activePrincipal + "')" ); - + if ( log.isDebugEnabled() ) + { + log.debug( "Proxied artifact '" + resourceFile.getName() + "' in repository '" + + managedRepository.getId() + "' (current user '" + activePrincipal + + "')" ); + } triggerAuditEvent( request.getRemoteAddr(), archivaLocator.getRepositoryId(), logicalResource.getPath(), event, activePrincipal ); } @@ -649,10 +652,11 @@ public class ArchivaDavResourceFactory File proxiedFile = connectors.fetchFromProxies( managedRepository, artifact ); resource.setPath( managedRepository.toPath( artifact ) ); - - log.debug( "Proxied artifact '" + artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" - + artifact.getVersion() + "'" ); - + if ( log.isDebugEnabled() ) + { + log.debug( "Proxied artifact '" + artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + + artifact.getVersion() + "'" ); + } return ( proxiedFile != null ); } } @@ -958,9 +962,12 @@ public class ArchivaDavResourceFactory catch ( DavException e ) { // TODO: review exception handling - log.debug( - "Skipping repository '" + managedRepository + "' for user '" + activePrincipal + "': " - + e.getMessage() ); + if ( log.isDebugEnabled() ) + { + log.debug( + "Skipping repository '" + managedRepository + "' for user '" + activePrincipal + + "': " + e.getMessage() ); + } } } else @@ -979,9 +986,12 @@ public class ArchivaDavResourceFactory catch ( UnauthorizedException e ) { // TODO: review exception handling - log.debug( - "Skipping repository '" + managedRepository + "' for user '" + activePrincipal + "': " - + e.getMessage() ); + if ( log.isDebugEnabled() ) + { + log.debug( + "Skipping repository '" + managedRepository + "' for user '" + activePrincipal + + "': " + e.getMessage() ); + } } } } diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/RepositoryServlet.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/RepositoryServlet.java index d79540df2..4b7d31c30 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/RepositoryServlet.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/RepositoryServlet.java @@ -76,7 +76,7 @@ public class RepositoryServlet private final Object reloadLock = new Object(); - public void init( javax.servlet.ServletConfig servletConfig ) + public void init( ServletConfig servletConfig ) throws ServletException { super.init( servletConfig ); |