cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r1206862 - in /cxf/trunk: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ rt/frontend/jaxrs/src/m...
Date Sun, 27 Nov 2011 22:07:55 GMT
Author: bimargulies
Date: Sun Nov 27 22:07:53 2011
New Revision: 1206862

URL: http://svn.apache.org/viewvc?rev=1206862&view=rev
Log:
 CXF-3936: fix name of new param to be 'required'

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/multipart/Multipart.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/multipart/AttachmentUtils.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartStore.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=1206862&r1=1206861&r2=1206862&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
Sun Nov 27 22:07:53 2011
@@ -44,7 +44,7 @@ public @interface Multipart {
      * the {@link org.apache.cxf.jaxrs.provider.MultipartProvider} 
      * throws a {@link javax.ws.rs.WebApplicationException}
      * with status 400. If this option is set to <strong>false</strong>,
-     * the parameter is set to <strong>null</strong>.
+     * the parameter is set to <strong>null</strong> instead.
      */
-    boolean errorIfMissing() default true; 
+    boolean required() default true; 
 }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java?rev=1206862&r1=1206861&r2=1206862&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java
Sun Nov 27 22:07:53 2011
@@ -167,7 +167,7 @@ public class MultipartProvider extends A
         Attachment multipart = AttachmentUtils.getMultipart(c, id, mt, infos);
         if (multipart != null) {
             return fromAttachment(multipart, c, t, anns);
-        } else if (id != null && !id.errorIfMissing()) {
+        } else if (id != null && !id.required()) {
             /*
              * If user asked for a null, give them a null. 
              */

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java?rev=1206862&r1=1206861&r2=1206862&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/FormUtils.java Sun
Nov 27 22:07:53 2011
@@ -157,7 +157,7 @@ public final class FormUtils {
                 || cd.getParameter("name") == null) {
                 Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
                 
-                if (id == null || id.errorIfMissing()) {
+                if (id == null || id.required()) {
                     throw new WebApplicationException(400);
                 } else {
                     return;

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/multipart/AttachmentUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/multipart/AttachmentUtils.java?rev=1206862&r1=1206861&r2=1206862&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/multipart/AttachmentUtils.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/multipart/AttachmentUtils.java
Sun Nov 27 22:07:53 2011
@@ -109,7 +109,7 @@ public final class AttachmentUtils {
                     return a;    
                 }
             }
-            if (id.errorIfMissing()) {
+            if (id.required()) {
                 org.apache.cxf.common.i18n.Message errorMsg = 
                     new org.apache.cxf.common.i18n.Message("MULTTIPART_ID_NOT_FOUND", 
                                                            BUNDLE, 

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartStore.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartStore.java?rev=1206862&r1=1206861&r2=1206862&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartStore.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/MultipartStore.java
Sun Nov 27 22:07:53 2011
@@ -147,7 +147,7 @@ public class MultipartStore {
     @Path("/books/testnullpart")
     @Consumes("multipart/form-data")
     @Produces("text/plain")
-    public String testNullPart(@Multipart(value = "someid", errorIfMissing = false) String
value) {
+    public String testNullPart(@Multipart(value = "someid", required = false) String value)
{
         if (value != null) {
             return value;
         } else {



Mime
View raw message