* 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;
/**
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;
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;
{
try
{
- VersionedReference versionRef = metadataTools.toVersionedReference( requestedResource );
+ metadataTools.toVersionedReference( requestedResource );
return false;
}
catch ( RepositoryMetadataException re )
public class ArchivaDavSession implements DavSession
{
- private final HashSet lockTokens = new HashSet();
+ private final HashSet<String> lockTokens = new HashSet<String>();
public void addLockToken(String token)
{
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 )
private static final String COMPLIANCE_CLASS = "1";
- private MimeTypes mimeTypes;
-
private ArchivaDavResourceLocator locator;
private DavResourceFactory factory;
{
this.localResources = localResources;
this.logicalResource = logicalResource;
- this.mimeTypes = mimeTypes;
this.locator = locator;
this.factory = factory;
this.properties = new DavPropertySet();
}
+ @SuppressWarnings("unchecked")
public MultiStatusResponse alterProperties( List arg0 )
throws DavException
{
*/
public class IndexWriter
{
- private final DavResource resource;
-
private final String logicalResource;
private final List<File> localResources;
public IndexWriter(DavResource resource, File localResource, String logicalResource)
{
- this.resource = resource;
this.localResources = new ArrayList<File>();
this.localResources.add( localResource );
this.logicalResource = logicalResource;
public IndexWriter( DavResource resource, List<File> localResources, String logicalResource )
{
- this.resource = resource;
this.logicalResource = logicalResource;
this.localResources = localResources;
this.isVirtual = true;
private String resource = "org/apache/maven/archiva/webdav/util/mime.types";
- private Map mimeMap = new HashMap();
+ private Map<String, String> mimeMap = new HashMap<String, String>();
private Logger log = LoggerFactory.getLogger( MimeTypes.class );
*/
public class WebdavMethodUtil
{
- private static final List READ_METHODS;
+ private static final List<String> READ_METHODS;
static
{
- READ_METHODS = new ArrayList();
+ READ_METHODS = new ArrayList<String>();
READ_METHODS.add( "HEAD" );
READ_METHODS.add( "GET" );
READ_METHODS.add( "PROPFIND" );
assertNull(request.getDavSession());
}
+ @SuppressWarnings("unchecked")
private class HttpServletRequestMock implements HttpServletRequest
{
public Object getAttribute(String arg0) {
*/
import java.io.File;
+import java.util.Collections;
import org.apache.commons.io.FileUtils;
import org.apache.jackrabbit.webdav.DavException;
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;
private DavResource getDavResource(String logicalPath, File file)
{
return new ArchivaDavResource( file.getAbsolutePath(), logicalPath, repository, session, resourceLocator,
- resourceFactory, mimeTypes, Collections.emptyList(), consumers );
+ resourceFactory, mimeTypes, Collections.<AuditListener>emptyList(), consumers );
}
public void testDeleteNonExistantResourceShould404()
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.<AuditListener>emptyList(), consumers );
}
}
}
* under the License.
*/
-import java.io.File;
/**
* RepositoryServlet Tests, Proxied, Get of Metadata, exists on remote repository only.
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 );
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 );
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 );
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 );
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 );
*/
import com.meterware.httpunit.HeaderOnlyWebRequest;
-import java.net.URL;
/**
* MkColMethodWebRequest