cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel Upload.java
Date Sun, 04 Jul 2004 14:37:00 GMT
joerg       2004/07/04 07:37:00

  Modified:    src/blocks/forms/java/org/apache/cocoon/forms/formmodel
                        Upload.java
  Log:
  provide a most simple implementation for setValue, object must be of type Part
  
  Revision  Changes    Path
  1.13      +5 -2      cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Upload.java
  
  Index: Upload.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel/Upload.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Upload.java	7 May 2004 13:42:09 -0000	1.12
  +++ Upload.java	4 Jul 2004 14:36:59 -0000	1.13
  @@ -59,7 +59,10 @@
       }
   
       public void setValue(Object object) {
  -        throw new RuntimeException("Cannot manually set the value of an upload widget for
field \"" + getRequestParameterName() + "\"");
  +        if (!(object instanceof Part)) {
  +            throw new RuntimeException("The value of an upload widget must be of type "
+ Part.class + ".");
  +        }
  +        this.part = (Part)object;
       }
   
       public void readFromRequest(FormContext formContext) {
  
  
  

Mime
View raw message