kward 2002/06/09 19:06:30
Modified: java/scratchpad/src/org/apache/xindice/server/rpc/messages GetDocument.java Log: added parameter checking Revision Changes Path 1.4 +10 -1 xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/GetDocument.java Index: GetDocument.java =================================================================== RCS file: /home/cvs/xml-xindice/java/scratchpad/src/org/apache/xindice/server/rpc/messages/GetDocument.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- GetDocument.java 2 Apr 2002 22:57:05 -0000 1.3 +++ GetDocument.java 10 Jun 2002 02:06:30 -0000 1.4 @@ -56,7 +56,7 @@ * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * - * $Id: GetDocument.java,v 1.3 2002/04/02 22:57:05 kstaken Exp $ + * $Id: GetDocument.java,v 1.4 2002/06/10 02:06:30 kward Exp $ */ import java.util.Hashtable; @@ -74,6 +74,15 @@ // TODO: should have a simple way to validate params. 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"); + } + Collection col = getCollection( (String) message.get(COLLECTION) ); Document doc = col.getDocument( (String) message.get(NAME) );