cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r1205996 - /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/Multipart.java
Date Thu, 24 Nov 2011 22:19:30 GMT
Author: bimargulies
Date: Thu Nov 24 22:19:29 2011
New Revision: 1205996

URL: http://svn.apache.org/viewvc?rev=1205996&view=rev
Log:
Add parameter for mapping missing parts to null.

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/Multipart.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/Multipart.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/Multipart.java?rev=1205996&r1=1205995&r2=1205996&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/Multipart.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/Multipart.java
Thu Nov 24 22:19:29 2011
@@ -24,9 +24,27 @@ import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
+/**
+ * Annotate a JAX-RS function parameter to receive data from a multipart 'part'.
+ **/
 @Target({ElementType.PARAMETER, ElementType.FIELD, ElementType.METHOD })
 @Retention(RetentionPolicy.RUNTIME)
 public @interface Multipart {
+    /**
+     * The name of the MIME part to map to this parameter. The default is
+     * the unnamed default part.
+     **/
     String value() default "";
+    /**
+     * Select the part by MIME type. The default is to match any MIME type.
+     */
     String type() default "*/*";
+    /**
+     * How to handle a missing part. By default, if no part matches,
+     * the {@link org.apache.cxf.jaxrs.provider.MultipartProvider} 
+     * throws a {@link javax.ws.rs.WebApplicationException}
+     * with status 404. If this option is set to <strong>false</strong>,
+     * the parameter is set to <strong>null</strong>.
+     */
+    boolean errorIfMissing() default true; 
 }



Mime
View raw message