[MOBY-guts] biomoby commit

Paul Gordon gordonp at dev.open-bio.org
Fri Apr 13 01:55:36 UTC 2007


gordonp
Thu Apr 12 21:55:36 EDT 2007
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data
In directory dev.open-bio.org:/tmp/cvs-serv872/src/main/org/biomoby/shared/data

Modified Files:
	MobyDataBytes.java 
Log Message:
Fixed contenmt member typo, made more verbose error messaging
moby-live/Java/src/main/org/biomoby/shared/data MobyDataBytes.java,1.5,1.6
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataBytes.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataBytes.java	2007/03/12 17:01:29	1.5
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/shared/data/MobyDataBytes.java	2007/04/13 01:55:36	1.6
@@ -23,7 +23,7 @@
 public class MobyDataBytes extends MobyDataComposite{
 
     public static final String BASE64_DATATYPE = "text-base64"; 
-    public static final String ENCODED_MEMBER_NAME = "contents"; 
+    public static final String ENCODED_MEMBER_NAME = "content"; 
 
     /** How much is read from a input stream (e.g. file) at once */
     public static final int BYTE_READ_SIZE = 4096;  
@@ -52,6 +52,13 @@
 	populateMembersFromDOM(element);
 
 	MobyDataObject contents = get(ENCODED_MEMBER_NAME);
+	if(contents == null){
+	    throw new MobyException("The encoded binary member (" + ENCODED_MEMBER_NAME + 
+				    ") of the given element (" +
+				    element.getLocalName()+
+				    ") was missing, but must exist to be a proper " +
+				    BASE64_DATATYPE + " object");
+	}
 	if(!(contents instanceof MobyDataString)){
 	    throw new MobyException("The encoded binary member (" + ENCODED_MEMBER_NAME + 
 				    ") of the given element (" +




More information about the MOBY-guts mailing list