kward       2002/06/09 19:05:28

  Modified:    java/scratchpad/src/org/apache/xindice/server/rpc/messages
                        CreateCollection.java
  Log:
  added parameter checking
  
  Revision  Changes    Path
  1.2       +10 -1     
xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/CreateCollection.java
  
  Index: CreateCollection.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/CreateCollection.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CreateCollection.java     2 Apr 2002 22:57:05 -0000       1.1
  +++ CreateCollection.java     10 Jun 2002 02:05:28 -0000      1.2
  @@ -56,7 +56,7 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    *
  - * $Id: CreateCollection.java,v 1.1 2002/04/02 22:57:05 kstaken Exp $
  + * $Id: CreateCollection.java,v 1.2 2002/06/10 02:05:28 kward Exp $
    */
   
   import java.util.Hashtable;
  @@ -75,6 +75,15 @@
   public class CreateCollection extends RPCDefaultMessage {   
      
      public Hashtable execute(Hashtable message) throws Exception {
  +
  +      if(!message.containsKey(COLLECTION)) {
  +         throw new Exception("Collection parameter not specified");
  +      }
  +
  +      if(!message.containsKey(NAME)) {
  +         throw new Exception("Name parameter not specified");
  +      }
  +
         CollectionManager colman = getCollection( (String) 
message.get(COLLECTION) );
         Document doc = new DocumentImpl();
   
  
  
  

Reply via email to