1 16 package org.apache.cocoon.environment; 17 18 import org.apache.excalibur.source.SourceException; 19 import org.apache.avalon.framework.component.ComponentException; 20 import org.apache.avalon.framework.component.ComponentManager; 21 import org.apache.cocoon.ProcessingException; 22 import org.apache.cocoon.components.source.URLSource; 23 import org.apache.cocoon.components.url.URLFactory; 24 import org.xml.sax.ContentHandler ; 25 import org.xml.sax.SAXException ; 26 27 import java.io.IOException ; 28 import java.net.MalformedURLException ; 29 import java.net.URL ; 30 import java.util.Map ; 31 32 39 40 public class URLFactorySourceResolver implements SourceResolver { 41 42 43 protected ComponentManager manager; 44 45 46 protected URLFactory urlFactory; 47 48 52 public URLFactorySourceResolver(ComponentManager manager) 53 throws ComponentException { 54 this.manager = manager; 55 this.urlFactory = (URLFactory)manager.lookup(URLFactory.ROLE); 56 } 57 58 62 public URLFactorySourceResolver(URLFactory factory, ComponentManager manager) { 63 this.urlFactory = factory; 64 this.manager = manager; 65 } 66 67 73 public Source resolve(String systemID) 74 throws ProcessingException, SAXException , IOException { 75 76 URL url = this.urlFactory.getURL(systemID); 77 return new URLSource(url, this.manager); 78 } 79 80 83 public org.apache.excalibur.source.Source resolveURI(final String location) 84 throws MalformedURLException , IOException , SourceException 85 { 86 return this.resolveURI(location, null, null); 87 } 88 89 92 public org.apache.excalibur.source.Source resolveURI(final String location, 93 String baseURI, 94 final Map parameters) 95 throws MalformedURLException , IOException , SourceException { 96 throw new RuntimeException ("URLFactorySourceResolver.resolveURI() is not implemented yet."); 97 } 98 99 102 public void release( final org.apache.excalibur.source.Source source ) { 103 throw new RuntimeException ("URLFactorySourceResolver.release() is not implemented yet."); 104 } 105 106 114 public void toSAX( org.apache.excalibur.source.Source source, 115 ContentHandler handler ) 116 throws SAXException , IOException , ProcessingException { 117 throw new RuntimeException ("ProcessingException.toSAX() is not implemented yet."); 118 } 119 120 128 public void toSAX( org.apache.excalibur.source.Source source, 129 String mimeTypeHint, 130 ContentHandler handler ) 131 throws SAXException , IOException , ProcessingException { 132 throw new RuntimeException ("ProcessingException.toSAX() is not implemented yet."); 133 } 134 } 135 | Popular Tags |