]> source.dussan.org Git - archiva.git/commitdiff
merged the following from trunk:
authorMaria Odea B. Ching <oching@apache.org>
Thu, 4 Sep 2008 03:37:44 +0000 (03:37 +0000)
committerMaria Odea B. Ching <oching@apache.org>
Thu, 4 Sep 2008 03:37:44 +0000 (03:37 +0000)
-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

archiva-1.1.x/archiva-jetty/pom.xml
archiva-1.1.x/archiva-jetty/src/main/assembly/bin.xml
archiva-1.1.x/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java
archiva-1.1.x/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletBrowseTest.java

index f51d8aa2f3588502ee41b24313af9d0b356a331f..12b09eab0b03f77a4940cab1cbbcf6d6df830cb8 100644 (file)
        <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>appassembler-maven-plugin</artifactId>
-        <version>1.0-beta-1</version>
+        <version>1.0-SNAPSHOT</version>
         <configuration>
           <daemons>
             <daemon>
                       <value>30</value>
                     </property>
                   </configuration>
+                  <includes>
+                    <include>linux-x86-32</include>
+                    <include>linux-x86-64</include>
+                    <include>macosx-x86-universal-32</include>
+                    <include>solaris-x86-32</include>
+                    <include>solaris-sparc-32</include>
+                    <include>solaris-sparc-64</include>
+                    <include>windows-x86-32</include>
+                  </includes>
                 </generatorConfiguration>
               </generatorConfigurations>
               <jvmSettings>
index 5b2f675e84226d1744884324414a05d9be4a7523..0e3206dfa03c49dbca95de11a02abe0da95a6aef 100644 (file)
       <outputDirectory>bin</outputDirectory>
       <includes>   
          <include>wrapper-linux-x86-32</include>
+         <include>wrapper-linux-x86-64</include>
          <include>wrapper-macosx-universal-32</include>
          <include>wrapper-solaris-x86-32</include>
+         <include>wrapper-solaris-sparc-32</include>
+         <include>wrapper-solaris-sparc-64</include>
       </includes>
       <fileMode>0755</fileMode>
     </fileSet>
index 861df090fa198ef6e1232586381fd0aebfd5c398..0e8277359d78f5c82c4bc103acd4b58bbd81b36c 100644 (file)
@@ -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(),
index baa76521bd51ac28ef828d1af38eee5e511dd6cb..169c90fab4876f64e17f1e3921e6e5cc931e19e3 100644 (file)
@@ -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[])
     {