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

2006/unicorn/src/org/w3c/unicorn/response Response.java,1.7,1.8

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 21 Sep 2009 09:38:24 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1MpfLk-0002H9-Nl@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/response
In directory hutz:/tmp/cvs-serv8710/src/org/w3c/unicorn/response

Modified Files:
	Response.java 
Log Message:
moved the filtering of the uri into the Response class

Index: Response.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/response/Response.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Response.java	18 Sep 2009 17:15:30 -0000	1.7
+++ Response.java	21 Sep 2009 09:38:22 -0000	1.8
@@ -7,6 +7,8 @@
 
 import javax.xml.datatype.XMLGregorianCalendar;
 
+import org.w3c.unicorn.Framework;
+
 public class Response {
 	protected String uri;
 	
@@ -265,6 +267,19 @@
 	public String getRequestUri() {
 		return requestUri;
 	}
+	
+	public String getFilteredRequestUri(String observerId) {
+		if (requestUri != null) {
+			String outputParamName = Framework.mapOfObserver.get(observerId).getParamOutputName();
+			return requestUri.replaceAll("&?" + outputParamName + "=[^&]*", "");
+		} else {
+			return null;
+		}
+	}
+	
+	public String getBaseURI(String observerId) {
+		return Framework.mapOfObserver.get(observerId).getListOfCallMethod().get(0).getURL().toString();
+	}
 
 	public void setRequestUri(String requestUri) {
 		this.requestUri = requestUri;
Received on Monday, 21 September 2009 09:38:33 GMT

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