From: James William Dumay Date: Wed, 4 Jun 2008 05:52:40 +0000 (+0000) Subject: MRM-781 - Removal of Archiva-Webdav implementation in favor of Jackrabbit-webdav X-Git-Tag: archiva-r676265~68 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=96f3712ef0df7813b3ef628b3ef2d7145406ebef;p=archiva.git MRM-781 - Removal of Archiva-Webdav implementation in favor of Jackrabbit-webdav * DELETE should 404 if resource does not exist * 93% litmus coverage git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@662989 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java index 78c1b0c8f..ee4602f92 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java @@ -329,6 +329,10 @@ public class ArchivaDavResource throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR ); } } + else + { + throw new DavException( HttpServletResponse.SC_NOT_FOUND ); + } } public void move( DavResource destination ) diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java index 46cd3af72..e091461a9 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java @@ -90,6 +90,22 @@ public class DavResourceTest extends PlexusInSpringTestCase return new ArchivaDavResource(file.getAbsolutePath(), logicalPath, mimeTypes, session, resourceLocator, resourceFactory); } + public void testDeleteNonExistantResourceShould404() + throws Exception + { + File dir = new File(baseDir, "testdir"); + try + { + DavResource directoryResource = getDavResource("/testdir", dir); + directoryResource.getCollection().removeMember(directoryResource); + fail("Did not throw DavException"); + } + catch (DavException e) + { + assertEquals(DavServletResponse.SC_NOT_FOUND, e.getErrorCode()); + } + } + public void testDeleteCollection() throws Exception {