chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fguilla...@apache.org
Subject svn commit: r805469 - in /incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server: CMISChildrenCollection.java CMISObjectsCollection.java CMISParentsCollection.java
Date Tue, 18 Aug 2009 15:58:28 GMT
Author: fguillaume
Date: Tue Aug 18 15:58:27 2009
New Revision: 805469

URL: http://svn.apache.org/viewvc?rev=805469&view=rev
Log:
Return proper 404 on missing object

Modified:
    incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISChildrenCollection.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISObjectsCollection.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISParentsCollection.java

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISChildrenCollection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISChildrenCollection.java?rev=805469&r1=805468&r2=805469&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISChildrenCollection.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISChildrenCollection.java
Tue Aug 18 15:58:27 2009
@@ -42,7 +42,8 @@
      */
 
     @Override
-    protected Feed createFeedBase(RequestContext request) {
+    protected Feed createFeedBase(RequestContext request)
+            throws ResponseContextException {
         Feed feed = super.createFeedBase(request);
 
         feed.addLink(getChildrenLink(id, request), AtomPub.LINK_SELF,
@@ -52,6 +53,9 @@
         SPI spi = repository.getSPI();
         ObjectEntry entry = spi.getProperties(spi.newObjectId(id), null, false,
                 false);
+        if (entry == null) {
+            throw new ResponseContextException("Not found: " + id, 404);
+        }
         String pid = (String) entry.getValue(Property.PARENT_ID);
         if (pid != null) {
             feed.addLink(getChildrenLink(pid, request), AtomPub.LINK_UP,

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISObjectsCollection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISObjectsCollection.java?rev=805469&r1=805468&r2=805469&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISObjectsCollection.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISObjectsCollection.java
Tue Aug 18 15:58:27 2009
@@ -77,7 +77,8 @@
      */
 
     @Override
-    protected Feed createFeedBase(RequestContext request) {
+    protected Feed createFeedBase(RequestContext request)
+            throws ResponseContextException {
         Factory factory = request.getAbdera().getFactory();
         Feed feed = factory.newFeed();
         feed.declareNS(CMIS.CMIS_NS, CMIS.CMIS_PREFIX);

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISParentsCollection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISParentsCollection.java?rev=805469&r1=805468&r2=805469&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISParentsCollection.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISParentsCollection.java
Tue Aug 18 15:58:27 2009
@@ -38,7 +38,8 @@
      */
 
     @Override
-    protected Feed createFeedBase(RequestContext request) {
+    protected Feed createFeedBase(RequestContext request)
+            throws ResponseContextException {
         Feed feed = super.createFeedBase(request);
         feed.addLink(getParentsLink(id, request), AtomPub.LINK_SELF,
                 AtomPub.MEDIA_TYPE_ATOM_FEED, null, null, -1);



Mime
View raw message