From: Maria Odea B. Ching Date: Thu, 4 Sep 2008 03:37:44 +0000 (+0000) Subject: merged the following from trunk: X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0ee111dab9f7743d12f64874a4750017663b770e;p=archiva.git merged the following from trunk: -r684620 (ignore IML) -r685059 (MRM-880: upgraded appassambler-maven-plugin version to latest snapshot; include solaris-sparc-32, solaris-sparc-64 and linux-x86-64 bin and lib files in the standalone bundle) -r685076 (MRM-893: return a 404 when the request is a resource file appended with a '/') git-svn-id: https://svn.apache.org/repos/asf/archiva/branches@691860 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-1.1.x/archiva-jetty/pom.xml b/archiva-1.1.x/archiva-jetty/pom.xml index f51d8aa2f..12b09eab0 100644 --- a/archiva-1.1.x/archiva-jetty/pom.xml +++ b/archiva-1.1.x/archiva-jetty/pom.xml @@ -142,7 +142,7 @@ org.codehaus.mojo appassembler-maven-plugin - 1.0-beta-1 + 1.0-SNAPSHOT @@ -200,6 +200,15 @@ 30 + + linux-x86-32 + linux-x86-64 + macosx-x86-universal-32 + solaris-x86-32 + solaris-sparc-32 + solaris-sparc-64 + windows-x86-32 + diff --git a/archiva-1.1.x/archiva-jetty/src/main/assembly/bin.xml b/archiva-1.1.x/archiva-jetty/src/main/assembly/bin.xml index 5b2f675e8..0e3206dfa 100644 --- a/archiva-1.1.x/archiva-jetty/src/main/assembly/bin.xml +++ b/archiva-1.1.x/archiva-jetty/src/main/assembly/bin.xml @@ -60,8 +60,11 @@ bin wrapper-linux-x86-32 + wrapper-linux-x86-64 wrapper-macosx-universal-32 wrapper-solaris-x86-32 + wrapper-solaris-sparc-32 + wrapper-solaris-sparc-64 0755 diff --git a/archiva-1.1.x/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java b/archiva-1.1.x/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java index 861df090f..0e8277359 100644 --- a/archiva-1.1.x/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java +++ b/archiva-1.1.x/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java @@ -409,6 +409,17 @@ public class ArchivaDavResourceFactory throws DavException { File resourceFile = new File( managedRepository.getRepoRoot(), logicalResource.getPath() ); + + //MRM-893, dont send back a file when user intentionally wants a directory + if ( locator.getHref( false ).endsWith( "/" ) ) + { + if ( ! resourceFile.isDirectory() ) + { + //force a resource not found + return null; + } + } + ArchivaDavResource resource = new ArchivaDavResource( resourceFile.getAbsolutePath(), logicalResource.getPath(), managedRepository.getRepository(), request.getRemoteAddr(), diff --git a/archiva-1.1.x/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletBrowseTest.java b/archiva-1.1.x/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletBrowseTest.java index baa76521b..169c90fab 100644 --- a/archiva-1.1.x/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletBrowseTest.java +++ b/archiva-1.1.x/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletBrowseTest.java @@ -72,6 +72,30 @@ public class RepositoryServletBrowseTest String expectedLinks[] = new String[] { "../", "apache/", "codehaus/" }; assertLinks(expectedLinks, response.getLinks()); } + + public void testGetDirectoryWhichHasMatchingFile() //MRM-893 + throws Exception + { + new File( repoRootInternal, "org/apache/archiva/artifactId/1.0" ).mkdirs(); + new File( repoRootInternal, "org/apache/archiva/artifactId/1.0/artifactId-1.0.jar" ).createNewFile(); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/org/apache/archiva/artifactId" ); + WebResponse response = sc.getResponse( request ); + assertEquals( "Response", HttpServletResponse.SC_OK, response.getResponseCode() ); + + request = new GetMethodWebRequest( "http://machine.com/repository/internal/org/apache/archiva/artifactId/" ); + response = sc.getResponse( request ); + assertEquals( "Response", HttpServletResponse.SC_OK, response.getResponseCode() ); + + request = new GetMethodWebRequest( "http://machine.com/repository/internal/org/apache/archiva/artifactId/1.0/artifactId-1.0.jar" ); + response = sc.getResponse( request ); + assertEquals( "Response", HttpServletResponse.SC_OK, response.getResponseCode() ); + + request = new GetMethodWebRequest( "http://machine.com/repository/internal/org/apache/archiva/artifactId/1.0/artifactId-1.0.jar/" ); + response = sc.getResponse( request ); + assertEquals( "Response", HttpServletResponse.SC_NOT_FOUND, response.getResponseCode() ); + } + private void assertLinks(String expectedLinks[], WebLink actualLinks[]) {