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
This commit is contained in:
Maria Odea B. Ching 2008-09-04 03:37:44 +00:00
parent ff13bfb026
commit 0ee111dab9
4 changed files with 48 additions and 1 deletions

View File

@ -142,7 +142,7 @@
<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>
@ -200,6 +200,15 @@
<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>

View File

@ -60,8 +60,11 @@
<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>

View 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(),

View 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[])
{