You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by st...@apache.org on 2003/07/24 09:18:26 UTC

cvs commit: cocoon-2.1/src/test/org/apache/cocoon/components/source SourceResolverAdapter.java

stephan     2003/07/24 00:18:25

  Modified:    src/test/org/apache/cocoon/components/source
                        SourceResolverAdapter.java
  Log:
  Throwing an exception instead of using AvalonToCocoonSource to
  remove the dependency to the deprecated package.
  
  Revision  Changes    Path
  1.7       +3 -48     cocoon-2.1/src/test/org/apache/cocoon/components/source/SourceResolverAdapter.java
  
  Index: SourceResolverAdapter.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/test/org/apache/cocoon/components/source/SourceResolverAdapter.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SourceResolverAdapter.java	17 May 2003 11:51:42 -0000	1.6
  +++ SourceResolverAdapter.java	24 Jul 2003 07:18:25 -0000	1.7
  @@ -59,7 +59,6 @@
   import org.apache.avalon.framework.component.ComponentException;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.cocoon.ProcessingException;
  -import org.apache.cocoon.components.source.impl.AvalonToCocoonSource;
   import org.apache.cocoon.environment.Source;
   import org.apache.cocoon.environment.SourceResolver;
   import org.apache.excalibur.xml.sax.SAXParser;
  @@ -68,6 +67,7 @@
   import org.xml.sax.SAXException;
   
   /**
  + * An adapter for the Excalibur SourceResolver.
    *
    * @version CVS $Id$
    */
  @@ -128,51 +128,6 @@
       public Source resolve(String systemID)
           throws ProcessingException, SAXException, IOException {
   
  -        try {
  -            return new AvalonToCocoonSource(this.resolver.resolveURI(systemID), this.resolver, null, manager);
  -        } catch (org.apache.excalibur.source.SourceException se) {
  -            throw new ProcessingException(se.toString());
  -        }
  -    }
  -
  -    /**
  -     * Generates SAX events from the given source
  -     * <b>NOTE</b> : if the implementation can produce lexical events, care should be taken
  -     * that <code>handler</code> can actually
  -     * directly implement the LexicalHandler interface!
  -     * @param  source    the data
  -     * @throws ProcessingException if no suitable converter is found
  -     */
  -    public void toSAX( org.apache.excalibur.source.Source source,
  -                ContentHandler handler )
  -        throws SAXException, IOException, ProcessingException {
  -
  -        SAXParser parser = null;
  -        try {
  -            parser = (SAXParser) this.manager.lookup(SAXParser.ROLE);
  -
  -            parser.parse(new InputSource(source.getInputStream()), handler);
  -        } catch (ComponentException ce) {
  -            throw new ProcessingException("Couldn't xmlize source", ce);
  -        } catch (org.apache.excalibur.source.SourceException se) {
  -            throw new ProcessingException("Couldn't xmlize source", se);
  -        } finally {
  -            this.manager.release((Component) parser);
  -        } 
  -    }
  -
  -    /**
  -     * Generates SAX events from the given source
  -     * <b>NOTE</b> : if the implementation can produce lexical events, care should be taken
  -     * that <code>handler</code> can actually
  -     * directly implement the LexicalHandler interface!
  -     * @param  source    the data
  -     * @throws ProcessingException if no suitable converter is found
  -     */
  -    public void toSAX( org.apache.excalibur.source.Source source, String mimeType,
  -                ContentHandler handler )
  -        throws SAXException, IOException, ProcessingException {
  -
  -        this.toSAX( source, handler );
  +        throw new RuntimeException("Method SourceResolver.resolve(String) is deprecated");
       }
   }