org.apache.struts.upload
クラス MultipartBoundaryInputStream

java.lang.Object
  拡張java.io.InputStream
      拡張org.apache.struts.upload.MultipartBoundaryInputStream

推奨されていません。 Use the Commons FileUpload based multipart handler instead. This class will be removed after Struts 1.2.

public class MultipartBoundaryInputStream
extends java.io.InputStream

This class encapsulates parsing functionality for RFC1867, multipart/form-data. See MultipartBoundaryInputStreamTest and MultipartIterator for usage examples.


フィールドの概要
protected  java.lang.String boundary
          推奨されていません。 The boundary.
private  byte[] boundaryBytes
          推奨されていません。  
protected  boolean boundaryEncountered
          推奨されていません。 Whether or not the boundary has been encountered.
protected  long bytesRead
          推奨されていません。 The total number of bytes read so far.
private static byte CARRIAGE_RETURN
          推奨されていません。  
private static java.lang.String CONTENT_TYPE_APPLICATION_OCTET_STREAM
          推奨されていません。  
private static java.lang.String CONTENT_TYPE_TEXT_PLAIN
          推奨されていません。  
private static byte[] CRLF
          推奨されていません。  
private static java.lang.String DEFAULT_CONTENT_DISPOSITION
          推奨されていません。  
private static int DEFAULT_LINE_SIZE
          推奨されていません。  
private static java.lang.String DOUBLE_DASH_STRING
          推奨されていません。  
protected  java.lang.String elementCharset
          推奨されていません。 The character encoding of the element, specified in the element's Content-Type header.
protected  java.lang.String elementContentDisposition
          推奨されていません。 The Content-Disposition for the current form element being read.
protected  java.lang.String elementContentType
          推奨されていません。 The Content-Type of the current form element being read.
protected  java.lang.String elementFileName
          推奨されていません。 The filename of the current form element being read, null if the current form element is text data.
protected  java.lang.String elementName
          推奨されていません。 The name of the current form element being read.
protected  boolean endOfStream
          推奨されていません。 Whether or not the end of the stream has been read.
private  byte[] finalBoundaryBytes
          推奨されていません。  
protected  boolean finalBoundaryEncountered
          推奨されていません。 Whether or not the final boundary has been encountered.
protected  java.io.InputStream inputStream
          推奨されていません。 The InputStream to read from.
private  byte[] line
          推奨されていません。  
private  boolean lineHasCarriage
          推奨されていません。  
private  boolean lineHasNewline
          推奨されていません。  
private  int lineIndex
          推奨されていません。  
private  int lineLength
          推奨されていません。  
private  int lineSize
          推奨されていません。  
protected  long maxLength
          推奨されていません。 The maximum length in bytes to read from the stream at a time, or -1 for unlimited length.
protected  boolean maxLengthMet
          推奨されていません。 Whether or not the maximum length has been met.
private static java.lang.String MESSAGE_INVALID_START
          推奨されていません。  
private static byte NEWLINE_BYTE
          推奨されていません。  
private static java.lang.String PARAMETER_CHARSET
          推奨されていません。  
private static java.lang.String PARAMETER_FILENAME
          推奨されていません。  
private static java.lang.String PARAMETER_NAME
          推奨されていません。  
private static char TOKEN_COLON
          推奨されていません。  
private static java.lang.String TOKEN_EQUALS
          推奨されていません。  
private static char TOKEN_QUOTE
          推奨されていません。  
private static char TOKEN_SEMI_COLON
          推奨されていません。  
private static char TOKEN_SPACE
          推奨されていません。  
 
クラス java.io.InputStream から継承したフィールド
 
コンストラクタの概要
MultipartBoundaryInputStream()
          推奨されていません。  
 
メソッドの概要
private  int availableInLine()
          推奨されていません。  
private  void byteRead()
          推奨されていません。  
private  java.lang.String checkAndFixFilename(java.lang.String filename)
          推奨されていません。  
private  void checkForBoundary()
          推奨されていません。  
private  boolean equals(byte[] comp, int offset, int length, byte[] source)
          推奨されていません。 Checks bytes for equality.
private  void fillLine()
          推奨されていません。  
private  void fillLineBuffer()
          推奨されていません。  
 long getBytesRead()
          推奨されていません。  
 java.lang.String getElementCharset()
          推奨されていません。 Gets the character encoding of the current element.
 java.lang.String getElementContentDisposition()
          推奨されていません。 Gets the value for the "Content-Dispositio" header for the current multipart element.
 java.lang.String getElementContentType()
          推奨されていません。 Gets the "Content-Type" of the current element.
 java.lang.String getElementFileName()
          推奨されていません。 Gets the filename of the current element, which will be null if the current element isn't a file.
 java.lang.String getElementName()
          推奨されていません。 Gets the name of the current element.
 long getMaxLength()
          推奨されていません。  
 boolean isBoundaryEncountered()
          推奨されていません。 Returns whether or not the boundary has been encountered while reading data.
 boolean isElementFile()
          推奨されていません。 Gets whether or not the current form element being read is a file.
 boolean isEndOfStream()
          推奨されていません。 Whether or not an EOF has been read on the stream.
 boolean isFinalBoundaryEncountered()
          推奨されていません。 Returns whether or not the final boundary has been encountered.
 boolean isMaxLengthMet()
          推奨されていません。 Whether or not the maximum length has been met.
 void mark(int i)
          推奨されていません。 Marks the underlying stream.
private  java.lang.String parseForParameter(java.lang.String parameter, java.lang.String parseString)
          推奨されていません。  
private  java.lang.String parseHeaderValue(java.lang.String headerLine)
          推奨されていません。  
 int read()
          推奨されていません。 Reads from the stream.
 int read(byte[] buffer)
          推奨されていません。  
 int read(byte[] buffer, int offset, int length)
          推奨されていません。  
private  void readContentDisposition()
          推奨されていません。  
private  boolean readContentType()
          推奨されていません。  
private  void readElementHeaders()
          推奨されていません。  
private  void readFirstElement()
          推奨されていません。  
private  int readFromLine()
          推奨されていません。  
private  java.lang.String readLine()
          推奨されていません。  
 void reset()
          推奨されていません。 Resets the underlying input stream.
private  void resetCrlf()
          推奨されていません。  
 void resetForNextBoundary()
          推奨されていません。 Resets this stream for use with the next element, to be used after a boundary is encountered.
private  void resetLine()
          推奨されていません。  
private  void resetStream()
          推奨されていません。  
 void setBoundary(java.lang.String boundary)
          推奨されていません。 Sets the boundary that terminates the data for the stream, after adding the prefix "--"
 void setInputStream(java.io.InputStream stream)
          推奨されていません。 Sets the input stream used to read multipart data.
 void setLineSize(int size)
          推奨されていません。  
 void setMaxLength(long maxLength)
          推奨されていません。 Set the maximum length in bytes to read, or -1 for an unlimited length.
private  void skipCurrentLineIfBlank()
          推奨されていません。  
 
クラス java.io.InputStream から継承したメソッド
available, close, markSupported, skip
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

NEWLINE_BYTE

private static final byte NEWLINE_BYTE
推奨されていません。 
関連項目:
定数フィールド値

CARRIAGE_RETURN

private static final byte CARRIAGE_RETURN
推奨されていません。 
関連項目:
定数フィールド値

CRLF

private static final byte[] CRLF
推奨されていません。 

DOUBLE_DASH_STRING

private static final java.lang.String DOUBLE_DASH_STRING
推奨されていません。 
関連項目:
定数フィールド値

DEFAULT_LINE_SIZE

private static final int DEFAULT_LINE_SIZE
推奨されていません。 
関連項目:
定数フィールド値

TOKEN_EQUALS

private static final java.lang.String TOKEN_EQUALS
推奨されていません。 
関連項目:
定数フィールド値

TOKEN_QUOTE

private static final char TOKEN_QUOTE
推奨されていません。 
関連項目:
定数フィールド値

TOKEN_COLON

private static final char TOKEN_COLON
推奨されていません。 
関連項目:
定数フィールド値

TOKEN_SEMI_COLON

private static final char TOKEN_SEMI_COLON
推奨されていません。 
関連項目:
定数フィールド値

TOKEN_SPACE

private static final char TOKEN_SPACE
推奨されていません。 
関連項目:
定数フィールド値

DEFAULT_CONTENT_DISPOSITION

private static final java.lang.String DEFAULT_CONTENT_DISPOSITION
推奨されていません。 
関連項目:
定数フィールド値

PARAMETER_NAME

private static final java.lang.String PARAMETER_NAME
推奨されていません。 
関連項目:
定数フィールド値

PARAMETER_FILENAME

private static final java.lang.String PARAMETER_FILENAME
推奨されていません。 
関連項目:
定数フィールド値

PARAMETER_CHARSET

private static final java.lang.String PARAMETER_CHARSET
推奨されていません。 
関連項目:
定数フィールド値

CONTENT_TYPE_TEXT_PLAIN

private static final java.lang.String CONTENT_TYPE_TEXT_PLAIN
推奨されていません。 
関連項目:
定数フィールド値

CONTENT_TYPE_APPLICATION_OCTET_STREAM

private static final java.lang.String CONTENT_TYPE_APPLICATION_OCTET_STREAM
推奨されていません。 
関連項目:
定数フィールド値

MESSAGE_INVALID_START

private static final java.lang.String MESSAGE_INVALID_START
推奨されていません。 
関連項目:
定数フィールド値

inputStream

protected java.io.InputStream inputStream
推奨されていません。 
The InputStream to read from.


boundary

protected java.lang.String boundary
推奨されていません。 
The boundary.


boundaryEncountered

protected boolean boundaryEncountered
推奨されていません。 
Whether or not the boundary has been encountered.


finalBoundaryEncountered

protected boolean finalBoundaryEncountered
推奨されていません。 
Whether or not the final boundary has been encountered.


endOfStream

protected boolean endOfStream
推奨されていません。 
Whether or not the end of the stream has been read.


elementContentDisposition

protected java.lang.String elementContentDisposition
推奨されていません。 
The Content-Disposition for the current form element being read.


elementName

protected java.lang.String elementName
推奨されていません。 
The name of the current form element being read.


elementContentType

protected java.lang.String elementContentType
推奨されていません。 
The Content-Type of the current form element being read.


elementFileName

protected java.lang.String elementFileName
推奨されていません。 
The filename of the current form element being read, null if the current form element is text data.


elementCharset

protected java.lang.String elementCharset
推奨されていません。 
The character encoding of the element, specified in the element's Content-Type header.


maxLength

protected long maxLength
推奨されていません。 
The maximum length in bytes to read from the stream at a time, or -1 for unlimited length.


maxLengthMet

protected boolean maxLengthMet
推奨されていません。 
Whether or not the maximum length has been met.


bytesRead

protected long bytesRead
推奨されていません。 
The total number of bytes read so far.


boundaryBytes

private byte[] boundaryBytes
推奨されていません。 

finalBoundaryBytes

private byte[] finalBoundaryBytes
推奨されていません。 

line

private byte[] line
推奨されていません。 

lineSize

private int lineSize
推奨されていません。 

lineLength

private int lineLength
推奨されていません。 

lineHasNewline

private boolean lineHasNewline
推奨されていません。 

lineHasCarriage

private boolean lineHasCarriage
推奨されていません。 

lineIndex

private int lineIndex
推奨されていません。 
コンストラクタの詳細

MultipartBoundaryInputStream

public MultipartBoundaryInputStream()
推奨されていません。 
メソッドの詳細

setBoundary

public void setBoundary(java.lang.String boundary)
推奨されていません。 
Sets the boundary that terminates the data for the stream, after adding the prefix "--"


resetForNextBoundary

public void resetForNextBoundary()
                          throws java.io.IOException
推奨されていません。 
Resets this stream for use with the next element, to be used after a boundary is encountered.

例外:
java.io.IOException

setInputStream

public void setInputStream(java.io.InputStream stream)
                    throws java.io.IOException
推奨されていません。 
Sets the input stream used to read multipart data. For efficiency purposes, make sure that the stream you set on this class is buffered. The way this class reads lines is that it continually calls the read() method until it reaches a newline character. That would be terrible if you were to set a socket's input stream here, but not as bad on a buffered stream.

例外:
java.io.IOException

read

public int read()
         throws java.io.IOException
推奨されていません。 
Reads from the stream. Returns -1 if it's the end of the stream or if a boundary is encountered.

例外:
java.io.IOException

read

public int read(byte[] buffer)
         throws java.io.IOException
推奨されていません。 
例外:
java.io.IOException

read

public int read(byte[] buffer,
                int offset,
                int length)
         throws java.io.IOException
推奨されていません。 
例外:
java.io.IOException

mark

public void mark(int i)
推奨されていません。 
Marks the underlying stream.


reset

public void reset()
           throws java.io.IOException
推奨されていません。 
Resets the underlying input stream.

例外:
java.io.IOException

setMaxLength

public void setMaxLength(long maxLength)
推奨されていません。 
Set the maximum length in bytes to read, or -1 for an unlimited length.


getMaxLength

public long getMaxLength()
推奨されていません。 

isMaxLengthMet

public boolean isMaxLengthMet()
推奨されていません。 
Whether or not the maximum length has been met.


getElementContentDisposition

public java.lang.String getElementContentDisposition()
推奨されていません。 
Gets the value for the "Content-Dispositio" header for the current multipart element. Usually "form-data".


getElementName

public java.lang.String getElementName()
推奨されていません。 
Gets the name of the current element. The name corresponds to the value of the "name" attribute of the form element.


getElementCharset

public java.lang.String getElementCharset()
推奨されていません。 
Gets the character encoding of the current element. The character encoding would have been specified in the Content-Type header for this element, if it wasn't this is null.


getElementContentType

public java.lang.String getElementContentType()
推奨されていません。 
Gets the "Content-Type" of the current element. If this is a text element, the content type will probably be "text/plain", otherwise it will be the content type of the file element.


getElementFileName

public java.lang.String getElementFileName()
推奨されていません。 
Gets the filename of the current element, which will be null if the current element isn't a file.


isElementFile

public boolean isElementFile()
推奨されていません。 
Gets whether or not the current form element being read is a file.


isBoundaryEncountered

public boolean isBoundaryEncountered()
推奨されていません。 
Returns whether or not the boundary has been encountered while reading data.


isFinalBoundaryEncountered

public boolean isFinalBoundaryEncountered()
推奨されていません。 
Returns whether or not the final boundary has been encountered.


isEndOfStream

public boolean isEndOfStream()
推奨されていません。 
Whether or not an EOF has been read on the stream.


setLineSize

public void setLineSize(int size)
推奨されていません。 

getBytesRead

public long getBytesRead()
推奨されていません。 

readFirstElement

private final void readFirstElement()
                             throws java.io.IOException
推奨されていません。 
例外:
java.io.IOException

readElementHeaders

private final void readElementHeaders()
                               throws java.io.IOException
推奨されていません。 
例外:
java.io.IOException

readContentDisposition

private final void readContentDisposition()
                                   throws java.io.IOException
推奨されていません。 
例外:
java.io.IOException

checkAndFixFilename

private final java.lang.String checkAndFixFilename(java.lang.String filename)
推奨されていません。 

parseForParameter

private final java.lang.String parseForParameter(java.lang.String parameter,
                                                 java.lang.String parseString)
推奨されていません。 

readContentType

private final boolean readContentType()
                               throws java.io.IOException
推奨されていません。 
例外:
java.io.IOException

parseHeaderValue

private final java.lang.String parseHeaderValue(java.lang.String headerLine)
推奨されていません。 

skipCurrentLineIfBlank

private final void skipCurrentLineIfBlank()
                                   throws java.io.IOException
推奨されていません。 
例外:
java.io.IOException

resetCrlf

private final void resetCrlf()
推奨されていません。 

resetStream

private final void resetStream()
推奨されていません。 

readLine

private final java.lang.String readLine()
                                 throws java.io.IOException
推奨されていません。 
例外:
java.io.IOException

readFromLine

private final int readFromLine()
                        throws java.io.IOException
推奨されていません。 
例外:
java.io.IOException

availableInLine

private final int availableInLine()
推奨されていません。 

fillLine

private final void fillLine()
                     throws java.io.IOException
推奨されていません。 
例外:
java.io.IOException

resetLine

private final void resetLine()
推奨されていません。 

fillLineBuffer

private final void fillLineBuffer()
                           throws java.io.IOException
推奨されていません。 
例外:
java.io.IOException

byteRead

private final void byteRead()
推奨されていません。 

checkForBoundary

private final void checkForBoundary()
推奨されていません。 

equals

private final boolean equals(byte[] comp,
                             int offset,
                             int length,
                             byte[] source)
推奨されていません。 
Checks bytes for equality. Two byte arrays are equal if each of their elements are the same. This method checks comp[offset] with source[0] to source[length-1] with comp[offset + length - 1]

パラメータ:
comp - The byte to compare to source
offset - The offset to start at in comp
length - The length of comp to compare to
source - The reference byte array to test for equality


このドキュメントは、Ja-Jakartaにより訳されました。コメントがある場合は、report@jajakarta.orgまでお願いします。
Copyright (C) 2000-2004 - Apache Software Foundation