org.apache.commons.fileupload
クラス DiskFileUpload

java.lang.Object
  拡張org.apache.commons.fileupload.FileUploadBase
      拡張org.apache.commons.fileupload.DiskFileUpload

public class DiskFileUpload
extends FileUploadBase

ファイルアップロードを処理するための高レベルAPIです。

High level API for processing file uploads.

このクラスは RFC 1867 によって規定された multipart/mixed エンコーディングタイプを使用して HTML ウィジェットから送信された複数のファイルを処理します。 FileUploadBase.parseRequest(HttpServletRequest) を使用して、 HTMLウィジェットから送られたデータを示す FileItem のリストを取得します。

This class handles multiple files per single HTML widget, sent using multipart/mixed encoding type, as specified by RFC 1867. Use {@link #parseRequest(HttpServletRequest)} to acquire a list of {@link org.apache.commons.fileupload.FileItem}s associated with a given HTML widget.

個々のパーツはサイズに応じて一時ディスク領域またはメモリ上に保持され、 FileItem から取得することが可能です。

Individual parts will be stored in temporary disk storage or in memory, depending on their size, and will be available as {@link org.apache.commons.fileupload.FileItem}s.

バージョン:
$Id: DiskFileUpload.java,v 1.6 2004/04/20 15:03:31 hioki Exp $
作成者:
Rafal Krzewski, Daniel Rall, Jason van Zyl, John McNally, Martin Cooper, Sean C. Sullivan
翻訳者:
日置 聡
校正者:
入江 弘憲
翻訳状況:
校了

入れ子クラスの概要
 
クラス org.apache.commons.fileupload.FileUploadBase から継承した入れ子クラス
FileUploadBase.InvalidContentTypeException, FileUploadBase.SizeLimitExceededException, FileUploadBase.UnknownSizeException
 
フィールドの概要
private  DefaultFileItemFactory fileItemFactory
          新規フォームアイテムを作成するためのファクトリ。
 
クラス org.apache.commons.fileupload.FileUploadBase から継承したフィールド
ATTACHMENT, CONTENT_DISPOSITION, CONTENT_TYPE, FORM_DATA, MAX_HEADER_SIZE, MULTIPART, MULTIPART_FORM_DATA, MULTIPART_MIXED
 
コンストラクタの概要
DiskFileUpload()
          標準のファクトリを用いて FileItem インスタンスを生成する、 このクラスのインスタンスを作成します。
DiskFileUpload(DefaultFileItemFactory fileItemFactory)
          指定されたファクトリを用いて FileItem インスタンスを生成する、 このクラスのインスタンスを作成します。
 
メソッドの概要
 FileItemFactory getFileItemFactory()
          ファイルアイテムを生成する際に使用するファクトリクラスを返します。
 String getRepositoryPath()
          設定された閾値のサイズを超えた一時ファイルが保存される場所を返します。
 int getSizeThreshold()
          これを超えたらディスク上にファイルを保存するサイズ閾値を返します。
 List parseRequest(javax.servlet.http.HttpServletRequest req, int sizeThreshold, long sizeMax, String path)
          RFC 1867 の仕様に従って multipart/form-data のストリームを処理します。
 void setFileItemFactory(FileItemFactory factory)
          ファイルアイテムを生成する際に使用するファクトリクラスを設定します。
 void setRepositoryPath(String repositoryPath)
          設定された閾値のサイズを超えた一時ファイルが保存される場所を設定します。
 void setSizeThreshold(int sizeThreshold)
          これを超えたらディスク上にファイルを保存するサイズ閾値を設定します。
 
クラス org.apache.commons.fileupload.FileUploadBase から継承したメソッド
createItem, getFieldName, getFileName, getHeader, getHeaderEncoding, getSizeMax, isMultipartContent, parseHeaders, parseRequest, setHeaderEncoding, setSizeMax
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

fileItemFactory

private DefaultFileItemFactory fileItemFactory
新規フォームアイテムを作成するためのファクトリ。
The factory to use to create new form items.

コンストラクタの詳細

DiskFileUpload

public DiskFileUpload()
標準のファクトリを用いて FileItem インスタンスを生成する、 このクラスのインスタンスを作成します。
Constructs an instance of this class which uses the default factory to create FileItem instances.

関連項目:
DiskFileUpload(DefaultFileItemFactory fileItemFactory)

DiskFileUpload

public DiskFileUpload(DefaultFileItemFactory fileItemFactory)
指定されたファクトリを用いて FileItem インスタンスを生成する、 このクラスのインスタンスを作成します。
Constructs an instance of this class which uses the supplied factory to create FileItem instances.

関連項目:
DiskFileUpload()
メソッドの詳細

getFileItemFactory

public FileItemFactory getFileItemFactory()
ファイルアイテムを生成する際に使用するファクトリクラスを返します。
Returns the factory class used when creating file items.

定義:
クラス FileUploadBase 内の getFileItemFactory
戻り値:
ファイルアイテムを生成するファクトリクラス。
The factory class for new file items.

setFileItemFactory

public void setFileItemFactory(FileItemFactory factory)
ファイルアイテムを生成する際に使用するファクトリクラスを設定します。 ファクトリクラスは DefaultFileItemFactory もしくはこれを継承したクラスである必要があります。 そうでない場合 ClassCastException が投げられます。
Sets the factory class to use when creating file items. The factory must be an instance of DefaultFileItemFactory or a subclass thereof, or else a ClassCastException will be thrown.

定義:
クラス FileUploadBase 内の setFileItemFactory
パラメータ:
factory - ファイルアイテムを生成するファクトリクラス。
The factory class for new file items.

getSizeThreshold

public int getSizeThreshold()
これを超えたらディスク上にファイルを保存するサイズ閾値を返します。
Returns the size threshold beyond which files are written directly to disk.

戻り値:
バイト単位のサイズ閾値。
The size threshold, in bytes.
関連項目:
setSizeThreshold(int)

setSizeThreshold

public void setSizeThreshold(int sizeThreshold)
これを超えたらディスク上にファイルを保存するサイズ閾値を設定します。
Sets the size threshold beyond which files are written directly to disk.

パラメータ:
sizeThreshold - バイト単位のサイズ閾値。
sizeThreshold The size threshold, in bytes.
関連項目:
getSizeThreshold()

getRepositoryPath

public String getRepositoryPath()
設定された閾値のサイズを超えた一時ファイルが保存される場所を返します。
Returns the location used to temporarily store files that are larger than the configured size threshold.

戻り値:
一時ファイルが保存されるパス。
The path to the temporary file location.
関連項目:
setRepositoryPath(String)

setRepositoryPath

public void setRepositoryPath(String repositoryPath)
設定された閾値のサイズを超えた一時ファイルが保存される場所を設定します。
Sets the location used to temporarily store files that are larger than the configured size threshold.

パラメータ:
repositoryPath - 一時ファイルが保存されるパス。
repositoryPath The path to the temporary file location.
関連項目:
getRepositoryPath()

parseRequest

public List parseRequest(javax.servlet.http.HttpServletRequest req,
                         int sizeThreshold,
                         long sizeMax,
                         String path)
                  throws FileUploadException
RFC 1867 の仕様に従って multipart/form-data のストリームを処理します。 ファイルがディスク上に保持される場合には getRepository() によってそのパスを取得することができます。
Processes an RFC 1867 compliant multipart/form-data stream. If files are stored on disk, the path is given by getRepository().

パラメータ:
req - 処理対象となるサーブレットリクエスト。 null は受け付けません。
The servlet request to be parsed. Must be non-null.
sizeThreshold - メモリに保持する最大サイズ(バイト単位)。
The max size in bytes to be stored in memory.
sizeMax - アップロードを許可する最大サイズ(バイト単位)。
The maximum allowed upload size, in bytes.
path - ファイルにてデータを保持する場合の場所。
The location where the files should be stored.
戻り値:
このリクエストを処理して生成された FileItem インスタンスのリスト。 送信された順番に並びます。
A list of FileItem instances parsed from the request, in the order that they were transmitted.
例外:
FileUploadException - リクエストの読み込み、処理またはファイルの保持にて 問題が発生した場合。
if there are problems reading/parsing the request or storing files.


このドキュメントは、Ja-Jakartaにより訳されました。 コメントがある場合は report@jajakarta.orgまでお願いします。
Translated into Japanese by jajakarta.org. The original page is here.
Copyright (c) 2002-2003 - Apache Software Foundation