sylvain     01/05/17 04:40:49

  Added:       src/org/apache/cocoon/serialization BlockingSerializer.java
  Log:
  New serializer that blocks output for internal-only pipelines
  
  Revision  Changes    Path
  1.1                  
xml-cocoon2/src/org/apache/cocoon/serialization/BlockingSerializer.java
  
  Index: BlockingSerializer.java
  ===================================================================
  /*****************************************************************************
   * Copyright (C) The Apache Software Foundation. All rights reserved.        *
   * ------------------------------------------------------------------------- *
   * This software is published under the terms of the Apache Software License *
   * version 1.1, a copy of which has been included  with this distribution in *
   * the LICENSE file.                                                         *
   
*****************************************************************************/
  
  package org.apache.cocoon.serialization;
  
  import java.io.OutputStream;
  import java.io.IOException;
  
  import org.apache.cocoon.xml.AbstractXMLConsumer;
  import org.apache.avalon.framework.thread.ThreadSafe;
  
  import org.xml.sax.SAXException;
  
  /**
   * A <code>Serializer</code> that blocks any output, suitable for 
internal-only pipelines.
   *
   * @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a>
   * @version CVS $Revision: 1.1 $ $Date: 2001/05/17 11:40:47 $
   */
  
  public class BlockingSerializer extends AbstractXMLConsumer implements 
Serializer, ThreadSafe {
  
      /**
       * Always throw an <code>IOException</code> forbidding output.
       */
      public void setOutputStream(OutputStream out) throws IOException {
          getLogger().warn("External access attempted on internal-only 
pipeline");
          throw new IOException("Internal-only resource : access denied");
      }
  
      /**
       * Always return <code>null</code>.
       */
      public String getMimeType() {
          return null;
      }
  
  }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to