changeset 6117:427ef7172476

Add some debug output to FileUploadServiceImpl.
author Christian Lins <christian.lins@intevation.de>
date Tue, 28 May 2013 13:04:13 +0200
parents 4db57e2f35f5
children 97d055c24ad4
files gwt-client/src/main/java/org/dive4elements/river/client/server/FileUploadServiceImpl.java
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/FileUploadServiceImpl.java	Mon May 27 17:59:00 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/FileUploadServiceImpl.java	Tue May 28 13:04:13 2013 +0200
@@ -53,7 +53,7 @@
             Document result = client.callService(url, "fileupload", request);
 
             resp.setContentType("text/html");
-            
+
             PrintWriter respWriter = resp.getWriter();
             respWriter.write("<html><body><div style='font-face: Arial,Verdana,sans-serif; font-size: 11px'>");
 
@@ -82,7 +82,7 @@
 
 
     protected Document createFileXML(HttpServletRequest req) {
-           ServletFileUpload upload = new ServletFileUpload();
+        ServletFileUpload upload = new ServletFileUpload();
 
         try{
             FileItemIterator iter = upload.getItemIterator(req);
@@ -93,11 +93,13 @@
 
                 // Process the input stream
                 ByteArrayOutputStream out = new ByteArrayOutputStream();
-                int len;
+                int len, cnt = 0;
                 byte[] buffer = new byte[stream.available()];
                 while ((len = stream.read(buffer, 0, buffer.length)) != -1) {
                     out.write(buffer, 0, len);
+                    cnt += len;
                 }
+                logger.debug("FileUploadServiceImpl.createFileXML(): " + cnt + " bytes file to be uploaded");
 
                 buffer = Base64.encodeBase64(buffer);
                 String b64File = new String(buffer);

http://dive4elements.wald.intevation.org