org.apache.struts.upload
クラス CommonsMultipartRequestHandler.CommonsFormFile

java.lang.Object
  拡張org.apache.struts.upload.CommonsMultipartRequestHandler.CommonsFormFile
すべての実装インタフェース:
FormFile, java.io.Serializable
含まれているクラス:
CommonsMultipartRequestHandler

static class CommonsMultipartRequestHandler.CommonsFormFile
extends java.lang.Object
implements FormFile, java.io.Serializable

This class implements the Struts FormFile interface by wrapping the Commons FileUpload FileItem interface. This implementation is read-only; any attempt to modify an instance of this class will result in an UnsupportedOperationException.


フィールドの概要
(パッケージプライベート)  org.apache.commons.fileupload.FileItem fileItem
          The FileItem instance wrapped by this object.
 
コンストラクタの概要
CommonsMultipartRequestHandler.CommonsFormFile(org.apache.commons.fileupload.FileItem fileItem)
          Constructs an instance of this class which wraps the supplied file item.
 
メソッドの概要
 void destroy()
          Destroy all content for this form file.
protected  java.lang.String getBaseFileName(java.lang.String filePath)
          Returns the base file name from the supplied file path.
 java.lang.String getContentType()
          Returns the content type for this file.
 byte[] getFileData()
          Returns the data for this file as a byte array.
 java.lang.String getFileName()
          Returns the (client-side) file name for this file.
 int getFileSize()
          Returns the size, in bytes, of this file.
 java.io.InputStream getInputStream()
          Get an InputStream that represents this file.
 void setContentType(java.lang.String contentType)
          Sets the content type for this file.
 void setFileName(java.lang.String fileName)
          Sets the (client-side) file name for this file.
 void setFileSize(int filesize)
          Sets the size, in bytes, for this file.
 java.lang.String toString()
          Returns the (client-side) file name for this file.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

fileItem

org.apache.commons.fileupload.FileItem fileItem
The FileItem instance wrapped by this object.

コンストラクタの詳細

CommonsMultipartRequestHandler.CommonsFormFile

public CommonsMultipartRequestHandler.CommonsFormFile(org.apache.commons.fileupload.FileItem fileItem)
Constructs an instance of this class which wraps the supplied file item.

パラメータ:
fileItem - The Commons file item to be wrapped.
メソッドの詳細

getContentType

public java.lang.String getContentType()
Returns the content type for this file.

定義:
インタフェース FormFile 内の getContentType
戻り値:
A String representing content type.

setContentType

public void setContentType(java.lang.String contentType)
Sets the content type for this file.

NOTE: This method is not supported in this implementation.

定義:
インタフェース FormFile 内の setContentType
パラメータ:
contentType - A string representing the content type.

getFileSize

public int getFileSize()
Returns the size, in bytes, of this file.

定義:
インタフェース FormFile 内の getFileSize
戻り値:
The size of the file, in bytes.

setFileSize

public void setFileSize(int filesize)
Sets the size, in bytes, for this file.

NOTE: This method is not supported in this implementation.

定義:
インタフェース FormFile 内の setFileSize
パラメータ:
filesize - The size of the file, in bytes.

getFileName

public java.lang.String getFileName()
Returns the (client-side) file name for this file.

定義:
インタフェース FormFile 内の getFileName
戻り値:
The client-size file name.

setFileName

public void setFileName(java.lang.String fileName)
Sets the (client-side) file name for this file.

NOTE: This method is not supported in this implementation.

定義:
インタフェース FormFile 内の setFileName
パラメータ:
fileName - The client-side name for the file.

getFileData

public byte[] getFileData()
                   throws java.io.FileNotFoundException,
                          java.io.IOException
Returns the data for this file as a byte array. Note that this may result in excessive memory usage for large uploads. The use of the getInputStream method is encouraged as an alternative.

定義:
インタフェース FormFile 内の getFileData
戻り値:
An array of bytes representing the data contained in this form file.
例外:
java.io.FileNotFoundException - If some sort of file representation cannot be found for the FormFile
java.io.IOException - If there is some sort of IOException

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.FileNotFoundException,
                                          java.io.IOException
Get an InputStream that represents this file. This is the preferred method of getting file data.

定義:
インタフェース FormFile 内の getInputStream
例外:
java.io.FileNotFoundException - If some sort of file representation cannot be found for the FormFile
java.io.IOException - If there is some sort of IOException

destroy

public void destroy()
Destroy all content for this form file. Implementations should remove any temporary files or any temporary file data stored somewhere

定義:
インタフェース FormFile 内の destroy

getBaseFileName

protected java.lang.String getBaseFileName(java.lang.String filePath)
Returns the base file name from the supplied file path. On the surface, this would appear to be a trivial task. Apparently, however, some Linux JDKs do not implement File.getName() correctly for Windows paths, so we attempt to take care of that here.

パラメータ:
filePath - The full path to the file.
戻り値:
The base file name, from the end of the path.

toString

public java.lang.String toString()
Returns the (client-side) file name for this file.

戻り値:
The client-size file name.


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