-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/archiva-1.1.x@691860
13f79535-47bb-0310-9956-
ffa450edef68
<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>
<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>
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(),
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[])
{