Author: andrei_exadel
Date: 2008-04-11 06:10:45 -0400 (Fri, 11 Apr 2008)
New Revision: 7755
Modified:
trunk/framework/api/src/main/java/org/richfaces/model/UploadItem.java
Log:
RF-3032
Modified: trunk/framework/api/src/main/java/org/richfaces/model/UploadItem.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/UploadItem.java 2008-04-11
09:46:06 UTC (rev 7754)
+++ trunk/framework/api/src/main/java/org/richfaces/model/UploadItem.java 2008-04-11
10:10:45 UTC (rev 7755)
@@ -8,6 +8,8 @@
import java.io.File;
+import javax.faces.FacesException;
+
/**
* 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.
@@ -52,14 +54,21 @@
/**
* @return the file
*/
- public File getFile() {
+ public File getFile() throws Exception {
+ if (!isFile()) {
+ throw new FacesException("This method should be called only if Ajax4Jsf
filter's parameter 'createTempFiles' set up in TRUE value");
+ }
return file;
}
/**
* @return the bytes
+ * @throws Exception
*/
- public byte[] getData() {
+ public byte[] getData() throws Exception {
+ if (isFile()) {
+ throw new FacesException("This method should be called only if Ajax4Jsf
filter's parameter 'createTempFiles' set up in FALSE value");
+ }
return bytes;
}
Show replies by date