org.apache.commons.pipeline.stage
Class URLToInputStreamStage

java.lang.Object
  extended by org.apache.commons.pipeline.stage.BaseStage
      extended by org.apache.commons.pipeline.stage.URLToInputStreamStage
All Implemented Interfaces:
Stage

public class URLToInputStreamStage
extends BaseStage

Converts a URL into an InputStream. This stage keeps track of all input streams that are created and closes them at the release step.


Field Summary
 
Fields inherited from class org.apache.commons.pipeline.stage.BaseStage
context
 
Constructor Summary
URLToInputStreamStage()
          Creates a new instance of URLToInputStreamStage
 
Method Summary
 void process(Object obj)
          Takes a String or a URL object representing a URL and exqueues the input stream returned by opening that URL.
 void release()
          Ensure that all opened input streams are closed.
 
Methods inherited from class org.apache.commons.pipeline.stage.BaseStage
emit, emit, init, postprocess, preprocess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLToInputStreamStage

public URLToInputStreamStage()
Creates a new instance of URLToInputStreamStage

Method Detail

process

public void process(Object obj)
             throws StageException
Takes a String or a URL object representing a URL and exqueues the input stream returned by opening that URL.

Specified by:
process in interface Stage
Overrides:
process in class BaseStage
Parameters:
obj - A String or URL object
Throws:
StageException - an Exception thrown by an overriding implementation should be wrapped in a StageException

release

public void release()
Ensure that all opened input streams are closed.

Specified by:
release in interface Stage
Overrides:
release in class BaseStage
See Also:
Stage.release()


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.