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;
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;
}
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
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 )
{
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 )
{
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 )
{
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;
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;
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 );
}
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 );
}
}
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
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() );
+ }
}
}
}