chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fguilla...@apache.org
Subject svn commit: r923263 - /incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPConnection.java
Date Mon, 15 Mar 2010 14:39:24 GMT
Author: fguillaume
Date: Mon Mar 15 14:39:24 2010
New Revision: 923263

URL: http://svn.apache.org/viewvc?rev=923263&view=rev
Log:
Obey API and return null on nonexistent objects

Modified:
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPConnection.java

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPConnection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPConnection.java?rev=923263&r1=923262&r2=923263&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPConnection.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPConnection.java
Mon Mar 15 14:39:24 2010
@@ -349,7 +349,12 @@ public class APPConnection implements Co
     }
 
     public CMISObject getObject(ObjectId object) {
-        APPObjectEntry entry = getObjectEntry(object);
+        APPObjectEntry entry;
+        try {
+            entry = getObjectEntry(object);
+        } catch (ObjectNotFoundException e) {
+            return null;
+        }
         Type type = getRepository().getType(entry.getTypeId());
         switch (entry.getBaseType()) {
         case DOCUMENT:
@@ -459,7 +464,12 @@ public class APPConnection implements Co
 
     public ObjectEntry getProperties(ObjectId object, Inclusion inclusion) {
         // TODO inclusion
-        APPObjectEntry current = getObjectEntry(object);
+        APPObjectEntry current;
+        try {
+            current = getObjectEntry(object);
+        } catch (ObjectNotFoundException e) {
+            return null;
+        }
         String href = current.getLink(AtomPub.LINK_SELF);
         try {
             return connector.getEntry(href, object.getId());



Mime
View raw message