]> source.dussan.org Git - archiva.git/commitdiff
as there is String concat use log.isDebugEnabled
authorOlivier Lamy <olamy@apache.org>
Thu, 22 Sep 2011 22:18:06 +0000 (22:18 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 22 Sep 2011 22:18:06 +0000 (22:18 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1174420 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResource.java
archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java
archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/RepositoryServlet.java

index 3638c186b6bc04d84ce32f6add25fe7563afb3fc..2e19fe69969390366b26a5e094e6c9a5511f765d 100644 (file)
@@ -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 )
         {
index f40c647cbbbaa21bd725a1981acb4a315be921bb..fa59079bf8d561fc758cb2ee3e0cbc3299b6b794 100644 (file)
@@ -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() );
+                            }
                         }
                     }
                 }
index d79540df26c63ea57caa728b8877b24e6d2a7c32..4b7d31c3018a3435f772b9ab9c2c3ec681ec4d29 100644 (file)
@@ -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 );