abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r439517 - /incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/SimpleRequestHandler.java
Date Sat, 02 Sep 2006 01:11:30 GMT
Author: jmsnell
Date: Fri Sep  1 18:11:30 2006
New Revision: 439517

URL: http://svn.apache.org/viewvc?rev=439517&view=rev
Log:
Fixing compile errors

Modified:
    incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/SimpleRequestHandler.java

Modified: incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/SimpleRequestHandler.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/SimpleRequestHandler.java?rev=439517&r1=439516&r2=439517&view=diff
==============================================================================
--- incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/SimpleRequestHandler.java
(original)
+++ incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/SimpleRequestHandler.java
Fri Sep  1 18:11:30 2006
@@ -76,8 +76,8 @@
     Target target = requestContext.getTarget();
     String method = requestContext.getMethod();
     if (target != null) {
-      switch(target.getResourceType()) {
-        case SERVICE: {
+      ResourceType type = target.getResourceType();
+      if (type == ResourceType.SERVICE) {
           try {
             if (requestContext.getIfNoneMatch().equals("\"service\"")) 
               throw new AbderaServerException(
@@ -85,8 +85,7 @@
                 "Not Modified", "");
           } catch (NullPointerException npe) {}
           return getServiceDocument();
-        }
-        case COLLECTION: {
+      } else if (type == ResourceType.COLLECTION) {
           if (method.equals("GET")) {
             if (!target.getValue(1).equals("foo")) 
               throw new AbderaServerException(
@@ -124,8 +123,7 @@
               throw new AbderaServerException(e);
             }
           }
-        }
-        case ENTRY_EDIT: {
+      } else if (type == ResourceType.ENTRY_EDIT) {
           Entry entry = getEntryFromFeed(requestContext);
           if (entry == null)
             throw new AbderaServerException(
@@ -171,7 +169,6 @@
             entry.discard();
             return new EmptyResponseContext(204);
           }
-        }
       }
       return null;
     } else {



Mime
View raw message