rewrite-config-servlet 2.0.0.Beta3

org.ocpsoft.rewrite.servlet.config
Class Stream

java.lang.Object
  extended by org.ocpsoft.rewrite.config.DefaultOperationBuilder
      extended by org.ocpsoft.rewrite.servlet.config.HttpOperation
          extended by org.ocpsoft.rewrite.servlet.config.Stream
All Implemented Interfaces:
Operation, OperationBuilder, Parameterized

public abstract class Stream
extends HttpOperation
implements Parameterized

An Operation responsible for streaming a File on the host file-system to the ServletResponse.getOutputStream().

Author:
Lincoln Baxter, III

Field Summary
static org.ocpsoft.logging.Logger log
           
static String STREAM_KEY
           
protected  RegexParameterizedPatternBuilder target
           
 
Constructor Summary
Stream(File target)
           
 
Method Summary
static Stream from(File file)
          Create an Operation that streams the given File to the ServletResponse.getOutputStream().
 ParameterizedPatternBuilder getExpression()
           
 Set<String> getRequiredParameterNames()
           
 void setParameterStore(ParameterStore store)
           
static Operation to(File file)
          Create an Operation that duplicates content written to ServletResponse.getOutputStream() and writes it to the given File.
 
Methods inherited from class org.ocpsoft.rewrite.servlet.config.HttpOperation
perform, performHttp
 
Methods inherited from class org.ocpsoft.rewrite.config.DefaultOperationBuilder
and
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final org.ocpsoft.logging.Logger log

STREAM_KEY

public static final String STREAM_KEY

target

protected RegexParameterizedPatternBuilder target
Constructor Detail

Stream

public Stream(File target)
Method Detail

from

public static Stream from(File file)
Create an Operation that streams the given File to the ServletResponse.getOutputStream().

The given File path may be parameterized:

new File("/tmp/file.txt")
new File("c:\tmp\{param}.txt")
...

Parameters:
location - ParameterizedPattern specifying the location of the File.
See Also:
ConfigurationRuleParameterBuilder#where(String)}

to

public static Operation to(File file)
Create an Operation that duplicates content written to ServletResponse.getOutputStream() and writes it to the given File.


getRequiredParameterNames

public Set<String> getRequiredParameterNames()
Specified by:
getRequiredParameterNames in interface Parameterized

setParameterStore

public void setParameterStore(ParameterStore store)
Specified by:
setParameterStore in interface Parameterized

getExpression

public ParameterizedPatternBuilder getExpression()

rewrite-config-servlet 2.0.0.Beta3

Copyright © 2013 OCPsoft. All Rights Reserved.