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

2006/unicorn/src/org/w3c/unicorn/input URIInputParameter.java,1.3,1.4

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Thu, 17 Sep 2009 17:05:11 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1MoKPv-0002Li-1T@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/input
In directory hutz:/tmp/cvs-serv9009/src/org/w3c/unicorn/input

Modified Files:
	URIInputParameter.java 
Log Message:
removed FileNotFoundException which was never thrown because getContent() is not called on the URLConnection object. Replaced by a switch on getResponseCode()

Index: URIInputParameter.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/input/URIInputParameter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- URIInputParameter.java	17 Sep 2009 16:54:00 -0000	1.3
+++ URIInputParameter.java	17 Sep 2009 17:05:08 -0000	1.4
@@ -43,6 +43,9 @@
 			case HttpURLConnection.HTTP_UNAUTHORIZED:
 				message = new Message(Message.Level.ERROR, "$message_unauthorized_access", null);
 				throw new UnicornException(message);
+			case HttpURLConnection.HTTP_NOT_FOUND:
+				message = new Message(Message.Level.ERROR, "$message_document_not_found", null);
+				throw new UnicornException(message);
 			}
 			
 			String sMimeType = con.getContentType();
@@ -55,9 +58,6 @@
 		} catch (MimeTypeParseException e) {
 			Message message = new Message(Message.Level.ERROR, "$message_invalid_mime_type", null);
 			throw new UnicornException(message);
-		} catch (FileNotFoundException e) {
-			Message message = new Message(Message.Level.ERROR, "$message_document_not_found", null);
-			throw new UnicornException(message);
 		} catch (UnknownHostException e) { 
 			Message message = new Message(Message.Level.ERROR, "$message_unknown_host", null);
 			throw new UnicornException(message);
Received on Thursday, 17 September 2009 17:05:19 GMT

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