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
This commit is contained in:
Olivier Lamy 2011-09-22 22:18:06 +00:00
parent 98db72a675
commit 0157bc252d
3 changed files with 61 additions and 41 deletions

View 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 );
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,9 +400,12 @@ public class ArchivaDavResource
triggerAuditEvent( member, AuditEvent.REMOVE_FILE );
}
if ( log.isDebugEnabled() )
{
log.debug( ( resource.isDirectory() ? "Directory '" : "File '" ) + member.getDisplayName()
+ "' removed (current user '" + this.principal + "')" );
}
}
catch ( IOException e )
{
throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR );
@ -451,10 +455,12 @@ public class ArchivaDavResource
triggerAuditEvent( remoteAddr, locator.getRepositoryId(), logicalResource, AuditEvent.MOVE_FILE );
}
if ( log.isDebugEnabled() )
{
log.debug( ( isCollection() ? "Directory '" : "File '" ) + getLocalResource().getName() + "' moved to '"
+ destination + "' (current user '" + this.principal + "')" );
}
}
catch ( IOException e )
{
throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e );
@ -489,9 +495,13 @@ public class ArchivaDavResource
triggerAuditEvent( remoteAddr, locator.getRepositoryId(), logicalResource, AuditEvent.COPY_FILE );
}
log.debug( ( isCollection() ? "Directory '" : "File '" ) + getLocalResource().getName() + "' copied to '"
if ( log.isDebugEnabled() )
{
log.debug(
( isCollection() ? "Directory '" : "File '" ) + getLocalResource().getName() + "' copied to '"
+ destination + "' (current user '" + this.principal + "')" );
}
}
catch ( IOException e )
{
throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e );

View 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;
if ( log.isDebugEnabled() )
{
log.debug( "Proxied artifact '" + resourceFile.getName() + "' in repository '"
+ managedRepository.getId() + "' (current user '" + activePrincipal + "')" );
+ 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 ) );
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
if ( log.isDebugEnabled() )
{
log.debug(
"Skipping repository '" + managedRepository + "' for user '" + activePrincipal + "': "
+ e.getMessage() );
"Skipping repository '" + managedRepository + "' for user '" + activePrincipal
+ "': " + e.getMessage() );
}
}
}
else
@ -979,9 +986,12 @@ public class ArchivaDavResourceFactory
catch ( UnauthorizedException e )
{
// TODO: review exception handling
if ( log.isDebugEnabled() )
{
log.debug(
"Skipping repository '" + managedRepository + "' for user '" + activePrincipal + "': "
+ e.getMessage() );
"Skipping repository '" + managedRepository + "' for user '" + activePrincipal
+ "': " + e.getMessage() );
}
}
}
}

View 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 );