|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectorg.apache.struts.upload.MultipartIterator
The MultipartIterator class is responsible for reading the
input data of a multipart request and splitting it up into
input elements, wrapped inside of a
MultipartElement
for easy definition. To use this class, create a new instance
of MultipartIterator passing it a HttpServletRequest in the
constructor. Then use the getNextElement
method until it returns null, then you're finished. Example:
MultipartIterator iterator = new MultipartIterator(request);
MultipartElement element;
while ((element = iterator.getNextElement()) != null) {
//do something with element
}
MultipartElement| フィールドの概要 | |
protected java.lang.String |
boundary
推奨されていません。 The boundary for this multipart request |
protected int |
bufferSize
推奨されていません。 The amount of data read from a request at a time. |
protected int |
contentLength
推奨されていません。 The content length of this request |
protected java.lang.String |
contentType
推奨されていません。 The content-type. |
private static java.lang.String |
DEFAULT_ENCODING
推奨されていません。 The default encoding of a text element if none is specified. |
protected int |
diskBufferSize
推奨されていません。 The size in bytes written to the filesystem at a time [20K] |
private static java.lang.String |
FILE_PREFIX
推奨されていません。 |
static java.lang.String |
HEADER_CONTENT_DISPOSITION
推奨されていません。 The name of the Content-Disposition header. |
static java.lang.String |
HEADER_CONTENT_TYPE
推奨されていません。 The name of the Content-Type header. |
protected MultipartBoundaryInputStream |
inputStream
推奨されていません。 The InputStream to use to read the multipart data. |
protected boolean |
maxLengthExceeded
推奨されていません。 Whether the maximum length has been exceeded. |
protected long |
maxSize
推奨されていません。 The maximum file size in bytes allowed. |
static java.lang.String |
MESSAGE_CANNOT_RETRIEVE_BOUNDARY
推奨されていません。 The exception message for when the boundary of a multipart request can't be determined. |
private static java.lang.String |
PARAMETER_BOUNDARY
推奨されていません。 |
protected javax.servlet.http.HttpServletRequest |
request
推奨されていません。 The request instance for this class |
protected java.lang.String |
tempDir
推奨されていません。 The temporary directory to store files |
private static int |
TEXT_BUFFER_SIZE
推奨されていません。 The size in bytes to copy of text data at a time. |
| コンストラクタの概要 | |
MultipartIterator(javax.servlet.http.HttpServletRequest request)
推奨されていません。 Constructs a MultipartIterator with a default buffer size and no file size limit |
|
MultipartIterator(javax.servlet.http.HttpServletRequest request,
int bufferSize)
推奨されていません。 Constructs a MultipartIterator with the specified buffer size and no file size limit |
|
MultipartIterator(javax.servlet.http.HttpServletRequest request,
int bufferSize,
long maxSize)
推奨されていません。 Constructs a MultipartIterator with the specified buffer size and the specified file size limit in bytes |
|
MultipartIterator(javax.servlet.http.HttpServletRequest request,
int bufferSize,
long maxSize,
java.lang.String tempDir)
推奨されていません。 |
|
| メソッドの概要 | |
protected MultipartElement |
createFileMultipartElement()
推奨されていません。 Create a multipart element instance representing the file in the stream. |
protected java.io.File |
createLocalFile()
推奨されていません。 Creates a file on disk from the current mulitpart element. |
protected MultipartElement |
createTextMultipartElement(java.lang.String encoding)
推奨されていません。 Create a text element from the data in the body of the element. |
private void |
getBoundaryFromContentType()
推奨されていません。 Parses a content-type String for the boundary. |
int |
getBufferSize()
推奨されていません。 Get the maximum amount of bytes read from a line at one time |
private void |
getContentTypeOfRequest()
推奨されていません。 Gets the value of the Content-Type header of the request. |
protected java.lang.String |
getElementEncoding()
推奨されていません。 Get the character encoding used for this current multipart element. |
long |
getMaxSize()
推奨されていません。 Get the maximum post data size allowed for a multipart request |
MultipartElement |
getNextElement()
推奨されていません。 Retrieves the next element in the iterator if one exists. |
boolean |
isMaxLengthExceeded()
推奨されていません。 Whether or not the maximum length has been exceeded by the client. |
protected void |
parseRequest()
推奨されていません。 Handles retrieving the boundary and setting the input stream |
void |
setBufferSize(int bufferSize)
推奨されていません。 Set the maximum amount of bytes read from a line at one time |
void |
setMaxSize(long maxSize)
推奨されていません。 Set the maximum post data size allowed for a multipart request |
| クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
private static final java.lang.String DEFAULT_ENCODING
private static final int TEXT_BUFFER_SIZE
public static java.lang.String HEADER_CONTENT_TYPE
public static final java.lang.String HEADER_CONTENT_DISPOSITION
public static final java.lang.String MESSAGE_CANNOT_RETRIEVE_BOUNDARY
private static final java.lang.String PARAMETER_BOUNDARY
private static final java.lang.String FILE_PREFIX
protected javax.servlet.http.HttpServletRequest request
protected MultipartBoundaryInputStream inputStream
protected java.lang.String boundary
protected long maxSize
protected int contentLength
protected int diskBufferSize
protected int bufferSize
protected java.lang.String tempDir
protected java.lang.String contentType
protected boolean maxLengthExceeded
| コンストラクタの詳細 |
public MultipartIterator(javax.servlet.http.HttpServletRequest request)
throws java.io.IOException
request - The multipart request to iterate
public MultipartIterator(javax.servlet.http.HttpServletRequest request,
int bufferSize)
throws java.io.IOException
request - The multipart request to iteratebufferSize - The size in bytes that should be read from the input
stream at a times
public MultipartIterator(javax.servlet.http.HttpServletRequest request,
int bufferSize,
long maxSize)
throws java.io.IOException
request - The multipart request to iteratebufferSize - The size in bytes that should be read from the input
stream at a timesmaxSize - The maximum size in bytes allowed for a multipart element's data
public MultipartIterator(javax.servlet.http.HttpServletRequest request,
int bufferSize,
long maxSize,
java.lang.String tempDir)
throws java.io.IOException
| メソッドの詳細 |
protected void parseRequest()
throws java.io.IOException
java.io.IOException
public MultipartElement getNextElement()
throws java.io.IOException
MultipartElement
representing the next element in the request data
java.io.IOException - if the post size exceeds the maximum file size
passed in the 3 argument constructor or if the "ISO-8859-1" encoding isn't foundprotected java.lang.String getElementEncoding()
protected MultipartElement createTextMultipartElement(java.lang.String encoding)
throws java.io.IOException
encoding - The character encoding of the string.
java.io.IOException
protected MultipartElement createFileMultipartElement()
throws java.io.IOException
java.io.IOExceptionpublic void setBufferSize(int bufferSize)
ServletInputStream.readLine(byte[], int, int)public int getBufferSize()
ServletInputStream.readLine(byte[], int, int)public void setMaxSize(long maxSize)
maxSize - The maximum post data size in bytes, set to -1
for no limitpublic long getMaxSize()
public boolean isMaxLengthExceeded()
private final void getBoundaryFromContentType()
throws java.io.IOException
java.io.IOExceptionprivate final void getContentTypeOfRequest()
protected java.io.File createLocalFile()
throws java.io.IOException
java.io.IOException
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||