Author: ppitonak(a)redhat.com
Date: 2010-12-13 06:24:36 -0500 (Mon, 13 Dec 2010)
New Revision: 20521
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichFileUploadBean.java
Log:
* listener fixed
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichFileUploadBean.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichFileUploadBean.java 2010-12-13
11:00:24 UTC (rev 20520)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichFileUploadBean.java 2010-12-13
11:24:36 UTC (rev 20521)
@@ -30,8 +30,7 @@
import javax.faces.bean.ViewScoped;
import org.richfaces.component.UIFileUpload;
import org.richfaces.event.UploadEvent;
-import org.richfaces.model.UploadItem;
-
+import org.richfaces.model.UploadedFile;
import org.richfaces.tests.metamer.Attributes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -49,7 +48,7 @@
private static final long serialVersionUID = -1L;
private static Logger logger;
private Attributes attributes;
- private List<UploadItem> items;
+ private List<UploadedFile> files;
/**
* Initializes the managed bean.
@@ -58,7 +57,7 @@
public void init() {
logger = LoggerFactory.getLogger(getClass());
logger.debug("initializing bean " + getClass().getName());
- items = new ArrayList<UploadItem>();
+ files = new ArrayList<UploadedFile>();
attributes = Attributes.getUIComponentAttributes(UIFileUpload.class, getClass(),
false);
@@ -79,21 +78,20 @@
this.attributes = attributes;
}
- public List<UploadItem> getItems() {
- return items;
+ public List<UploadedFile> getItems() {
+ return files;
}
public void listener(UploadEvent event) {
- UploadItem item = event.getUploadItem();
+ UploadedFile file = event.getUploadedFile();
- if (item != null) {
- items.add(item);
- item.getFile().delete();
+ if (file != null) {
+ files.add(file);
}
}
public String clearUploadedData() {
- items.clear();
+ files.clear();
return null;
}
}