org.richfaces.model
Class UploadItem

java.lang.Object
  extended by org.richfaces.model.UploadItem
All Implemented Interfaces:
java.io.Serializable

public class UploadItem
extends java.lang.Object
implements java.io.Serializable

Class provides object holder for file uploaded. Instance of this type will be returned by UploadEvent after appropriate listener called after uploading has been completed.

Author:
"Andrey Markavtsov"
See Also:
Serialized Form

Constructor Summary
UploadItem(java.lang.String fileName, int fileSize, java.lang.String contentType, java.lang.Object file)
          Constructor for the UploadItem
 
Method Summary
 java.lang.String getContentType()
           
 byte[] getData()
          This method should called only in case of FALSE value returned by isTempFile() method.
 java.io.File getFile()
          This method should called only in case of TRUE value returned by isTempFile() method.
 java.lang.String getFileName()
           
 int getFileSize()
           
 boolean isTempFile()
          Return true if file is holding as java.io.File type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UploadItem

public UploadItem(java.lang.String fileName,
                  int fileSize,
                  java.lang.String contentType,
                  java.lang.Object file)
Constructor for the UploadItem

Method Detail

isTempFile

public boolean isTempFile()
Return true if file is holding as java.io.File type. If true getFile method should be invoked to get file uploaded. In another case getData method should be invoked to get file's bytes.

Returns:

getFile

public java.io.File getFile()
This method should called only in case of TRUE value returned by isTempFile() method. Otherwise null value will be returned by this method.

Returns:
the file

getData

public byte[] getData()
This method should called only in case of FALSE value returned by isTempFile() method. Otherwise null value will be returned by this method.

Returns:
the bytes
Throws:
java.lang.Exception

getFileName

public java.lang.String getFileName()
Returns:
the fileName

getContentType

public java.lang.String getContentType()
Returns:
the contentType

getFileSize

public int getFileSize()
Returns:
the fileSize


Copyright © 2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.