FileDocCategorySizeDatePackage
SavedRequestInputFilter.javaAPI DocApache Tomcat 6.0.143135Fri Jul 20 04:20:36 BST 2007org.apache.coyote.http11.filters

SavedRequestInputFilter

public class SavedRequestInputFilter extends Object implements org.apache.coyote.http11.InputFilter
Input filter responsible for replaying the request body when restoring the saved request after FORM authentication.

Fields Summary
protected org.apache.tomcat.util.buf.ByteChunk
input
The original request body.
Constructors Summary
public SavedRequestInputFilter(org.apache.tomcat.util.buf.ByteChunk input)
Create a new SavedRequestInputFilter.

param
input The saved request body to be replayed.


                       
       
        this.input = input;
    
Methods Summary
public intavailable()
Amount of bytes still available in a buffer.

        return input.getLength();
    
public intdoRead(org.apache.tomcat.util.buf.ByteChunk chunk, org.apache.coyote.Request request)
Read bytes.

        int writeLength = 0;
        
        if (chunk.getLimit() > 0 && chunk.getLimit() < input.getLength()) {
            writeLength = chunk.getLimit();
        } else {
        	writeLength = input.getLength();
        }
        
        if(input.getOffset()>= input.getEnd())
            return -1;
        
        input.substract(chunk.getBuffer(), 0, writeLength);
        chunk.setOffset(0);
        chunk.setEnd(writeLength);
        
        return writeLength;
    
public longend()
End the current request (has no effect).

        return 0;
    
public org.apache.tomcat.util.buf.ByteChunkgetEncodingName()
Return the name of the associated encoding; here, the value is null.

        return null;
    
public voidrecycle()
Make the filter ready to process the next request.

        input = null;
    
public voidsetBuffer(org.apache.coyote.InputBuffer buffer)
Set the next buffer in the filter pipeline (has no effect).

    
public voidsetRequest(org.apache.coyote.Request request)
Set the content length on the request.

        request.setContentLength(input.getLength());