chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fguilla...@apache.org
Subject svn commit: r892373 - /incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java
Date Fri, 18 Dec 2009 20:30:08 GMT
Author: fguillaume
Date: Fri Dec 18 20:30:08 2009
New Revision: 892373

URL: http://svn.apache.org/viewvc?rev=892373&view=rev
Log:
Add JAX-RS bridge of media PUT

Modified:
    incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java?rev=892373&r1=892372&r2=892373&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java
Fri Dec 18 20:30:08 2009
@@ -37,11 +37,11 @@
 import org.apache.abdera.protocol.server.RequestContext;
 import org.apache.abdera.protocol.server.ResponseContext;
 import org.apache.abdera.protocol.server.ServiceManager;
-import org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter;
 import org.apache.abdera.protocol.server.servlet.ServletRequestContext;
 import org.apache.chemistry.Repository;
 import org.apache.chemistry.atompub.AtomPub;
 import org.apache.chemistry.atompub.AtomPubCMIS;
+import org.apache.chemistry.atompub.server.CMISChildrenCollection;
 import org.apache.chemistry.atompub.server.CMISProvider;
 import org.apache.chemistry.atompub.server.jaxrs.AbderaResource.PathMunger.ContextAndServletPath;
 import org.apache.commons.logging.Log;
@@ -304,10 +304,19 @@
     public Response doGetFile() {
         // objectid decoded by Abdera getCollectionAdapter
         RequestContext requestContext = getRequestContext(2);
-        AbstractCollectionAdapter adapter = (AbstractCollectionAdapter) getAbderaCollectionAdapter(requestContext);
+        CMISChildrenCollection adapter = (CMISChildrenCollection) getAbderaCollectionAdapter(requestContext);
         return getResponse(adapter.getMedia(requestContext));
     }
 
+    @PUT
+    @Path("file/{objectid}")
+    public Response doPutFile() {
+        // objectid decoded by Abdera getCollectionAdapter
+        RequestContext requestContext = getRequestContext(2);
+        CMISChildrenCollection adapter = (CMISChildrenCollection) getAbderaCollectionAdapter(requestContext);
+        return getResponse(adapter.putMedia(requestContext));
+    }
+
     @POST
     @Consumes(AtomPubCMIS.MEDIA_TYPE_CMIS_QUERY)
     @Produces(AtomPub.MEDIA_TYPE_ATOM_FEED)



Mime
View raw message