changeset 12:ef16056a238b

~ move catalog code in its own file
author Alexandre Bertails <bertails@w3.org>
date Tue, 02 Mar 2010 15:04:01 -0500
parents 4438cf9210c6
children 531e7f7a9688
files src/main/scala/XML.scala
diffstat 1 files changed, 1 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/scala/XML.scala	Tue Mar 02 14:19:27 2010 -0500
+++ b/src/main/scala/XML.scala	Tue Mar 02 15:04:01 2010 -0500
@@ -1,6 +1,6 @@
 package org.w3c.util.xml
 
-import org.w3c.util.Tidy
+import org.w3c.util.{Tidy, CatalogLike}
 import java.io._
 import dispatch._
 import Http._
@@ -10,25 +10,6 @@
 import scala.xml.Elem
 import java.net._
 
-case class CachedResponse(in:InputStream) extends CacheResponse {
-  def getBody() = in
-  def getHeaders() = null
-}
-
-object CachedResponse {
-  def apply(file:File):CachedResponse = CachedResponse(new FileInputStream(file))
-  def apply(filename:String):CachedResponse = CachedResponse(new File(filename))
-}
-
-object CatalogLike extends ResponseCache {
-  def get(uri:URI, rqstMethod:String, rqstHeaders:java.util.Map[java.lang.String,java.util.List[java.lang.String]]) =
-    uri.toString match {
-      case "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" => CachedResponse("dtds/xhtml1-strict.dtd")
-      case _ => null
-    }
-  def put(uri:URI, conn:URLConnection) = null
-}
-
 object Node {
 
   ResponseCache.setDefault(CatalogLike)
Set up and maintained by W3C Systems Team, please report bugs to sysreq@w3.org.

W3C would like to thank Microsoft who donated the server that allows us to run this service.