org.apache.struts.upload
Class MultipartValueStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--org.apache.struts.upload.MultipartValueStream

Deprecated. Use the Commons FileUpload based multipart handler instead. This class will be removed after Struts 1.2.

class MultipartValueStream
extends java.io.InputStream

This class implements an inputStream that reads another stream until a multipart boundary is found. The class reports eof when boundary found. The undelying stream is not closed.

See RFC 1867 (http://info.internet.isi.edu:80/in-notes/rfc/files/rfc1867.txt) for details about the protocol.


Field Summary
private  byte[] boundaryBytes
          Deprecated. byte buffer with the boundary
private  boolean boundaryReached
          Deprecated. have we reached the boundary?
private  boolean finalBoundaryReached
          Deprecated. is the boundary found a final boundary?
static java.lang.String HEADER_ENCODING
          Deprecated.  
private  java.io.InputStream in
          Deprecated. the underlying stream
private  int matchedBoundaryBytes
          Deprecated. how many curretly matched boundary bytes?
private  int readAheadBufferEndI
          Deprecated. The end index for the read ahead cyclic buffer (points to the last byte)
private  int readAheadBufferStartI
          Deprecated. The start index for the read ahead cyclic buffer (points to the first byte)
private  byte[] readAheadBytes
          Deprecated. the read ahead buffer (cyclic)
 
Fields inherited from class java.io.InputStream
SKIP_BUFFER_SIZE, skipBuffer
 
Constructor Summary
MultipartValueStream(java.io.InputStream in, java.lang.String boundary)
          Deprecated. Create a stream that stops reading at the boundary NOTE: the boundary parameter is without the trailing dashes "--".
 
Method Summary
 boolean encounteredFinalBoundary()
          Deprecated.  
 int read()
          Deprecated. Read the next byte
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

HEADER_ENCODING

public static final java.lang.String HEADER_ENCODING
Deprecated. 

in

private java.io.InputStream in
Deprecated. 
the underlying stream

boundaryBytes

private byte[] boundaryBytes
Deprecated. 
byte buffer with the boundary

matchedBoundaryBytes

private int matchedBoundaryBytes
Deprecated. 
how many curretly matched boundary bytes?

readAheadBytes

private byte[] readAheadBytes
Deprecated. 
the read ahead buffer (cyclic)

readAheadBufferStartI

private int readAheadBufferStartI
Deprecated. 
The start index for the read ahead cyclic buffer (points to the first byte)

readAheadBufferEndI

private int readAheadBufferEndI
Deprecated. 
The end index for the read ahead cyclic buffer (points to the last byte)

boundaryReached

private boolean boundaryReached
Deprecated. 
have we reached the boundary?

finalBoundaryReached

private boolean finalBoundaryReached
Deprecated. 
is the boundary found a final boundary?
Constructor Detail

MultipartValueStream

public MultipartValueStream(java.io.InputStream in,
                            java.lang.String boundary)
                     throws java.io.IOException
Deprecated. 
Create a stream that stops reading at the boundary NOTE: the boundary parameter is without the trailing dashes "--".
Method Detail

read

public int read()
         throws java.io.IOException
Deprecated. 
Read the next byte
Overrides:
read in class java.io.InputStream
Returns:
-1 on boundary reached
Throws:
java.io.IOException - if the ending boundary is never found

encounteredFinalBoundary

public boolean encounteredFinalBoundary()
                                 throws javax.servlet.ServletException
Deprecated. 
Returns:
true if we are the last stream, ie. we encountered a final boundary
Throws:
javax.servlet.ServletException - if the boundary has not yet been reached


Copyright 2000-2006 - The Apache Software Foundation