W3C home > Mailing lists > Public > www-validator-cvs@w3.org > September 2009

2006/unicorn/src/org/w3c/unicorn UnicornCall.java,1.8,1.9

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Fri, 04 Sep 2009 15:35:17 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1Mjaon-0000cN-Tj@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn
In directory hutz:/tmp/cvs-serv2359/src/org/w3c/unicorn

Modified Files:
	UnicornCall.java 
Log Message:
throw a UnsupportedMimeType exception if the task does not support the request mime-type

Index: UnicornCall.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/UnicornCall.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- UnicornCall.java	4 Sep 2009 13:51:06 -0000	1.8
+++ UnicornCall.java	4 Sep 2009 15:35:15 -0000	1.9
@@ -30,6 +30,7 @@
 import org.w3c.unicorn.exceptions.EmptyDocumentException;
 import org.w3c.unicorn.exceptions.NoDocumentException;
 import org.w3c.unicorn.exceptions.NoMimeTypeException;
+import org.w3c.unicorn.exceptions.UnsupportedMimeTypeException;
 import org.w3c.unicorn.input.InputFactory;
 import org.w3c.unicorn.request.Request;
 import org.w3c.unicorn.request.RequestList;
@@ -129,6 +130,10 @@
 		// find mimetype of the document
 		MimeType aMimeType = this.getMimeType();
 
+		if (!aTask.getSupportedMimeTypes().contains(aMimeType.toString())) {
+			throw new UnsupportedMimeTypeException("Mime-type: " + aMimeType + " is not supported by this task.");
+		}
+		
 		// Create input method
 		final InputFactory aInputFactory = new InputFactory(aMimeType,
 				this.aEnumInputMethod, this.oInputParameterValue);
Received on Friday, 4 September 2009 15:35:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:13 GMT