james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From man...@apache.org
Subject svn commit: r1660217 - /james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/ComposeActivity.java
Date Mon, 16 Feb 2015 22:02:56 GMT
Author: manolo
Date: Mon Feb 16 22:02:55 2015
New Revision: 1660217

URL: http://svn.apache.org/r1660217
Log:
Fix the way to register uploaded files wiht new gwt-upload

Modified:
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/ComposeActivity.java

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/ComposeActivity.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/ComposeActivity.java?rev=1660217&r1=1660216&r2=1660217&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/ComposeActivity.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/ComposeActivity.java
Mon Feb 16 22:02:55 2015
@@ -24,6 +24,7 @@ import gwtupload.client.IUploader;
 import gwtupload.client.IUploader.OnCancelUploaderHandler;
 import gwtupload.client.IUploader.OnFinishUploaderHandler;
 import gwtupload.client.IUploader.OnStatusChangedHandler;
+import gwtupload.client.IUploader.UploadedInfo;
 
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -329,14 +330,16 @@ public class ComposeActivity extends App
     private OnFinishUploaderHandler onFinishUploadHandler = new OnFinishUploaderHandler()
{
         public void onFinish(IUploader uploader) {
             if (uploader.getStatus() == Status.SUCCESS) {
-                MessageAttachment attachment = new MessageAttachmentImpl();
                 // We use the fileInputName (unique) instead of the fileName so
                 // as we
                 // can find the item in the registry.
-                attachment.setName(uploader.getInputName());
-                attachment.setContentType(uploader.getServerInfo().ctype);
-                attachment.setSize(uploader.getServerInfo().size);
-                attachments.add(attachment);
+                for (UploadedInfo info : uploader.getServerMessage().getUploadedInfos())
{
+                  MessageAttachment attachment = new MessageAttachmentImpl();
+                  attachment.setName(info.getField());
+                  attachment.setContentType(info.getCtype());
+                  attachment.setSize(info.getSize());
+                  attachments.add(attachment);
+                }
             }
         }
     };



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message