Date: 2005-03-07T10:34:57
   Editor: DakotaJack
   Wiki: Apache Struts Wiki
   Page: StrutsUpload
   URL: http://wiki.apache.org/struts/StrutsUpload

   no comment

Change Log:

------------------------------------------------------------------------------
@@ -753,6 +753,24 @@
   public String  getSystemTempDir() { return UploadConstant.SYSTEM_TEMPDIR; }
   public List    getHistory()       { return history; }
 
+  public boolean isMultipart(HttpServletRequest req) {
+    return MultipartUtil.isMultipartFormData(req);
+  }
+
+  public Iterator getParameterNames() {
+    return data.getParameterNames();
+  }
+
+  public void process(HttpServletRequest req,
+                      List               monitors,
+                      String             encoding,
+                      int                maxFileSize)
+      throws UploadException,
+             IOException {
+    this.monitors = monitors;
+    data = new 
UploadMultipartData(req,monitors,UploadConstant.DEFAULT_ENCODING,UploadConstant.MAX_FILE_SIZE);
+  }
+
   public void store(int    storeType,
                     String storeLocation,
                     String tmpPath) // location null if memory
@@ -837,24 +855,6 @@
     return sb.toString();
   }
 
-  public boolean isMultipart(HttpServletRequest req) {
-    return MultipartUtil.isMultipartFormData(req);
-  }
-
-  public void process(HttpServletRequest req,
-                      List               monitors,
-                      String             encoding,
-                      int                maxFileSize)
-      throws UploadException,
-             IOException {
-    this.monitors = monitors;
-    data = new 
UploadMultipartData(req,monitors,UploadConstant.DEFAULT_ENCODING,UploadConstant.MAX_FILE_SIZE);
-  }
-
-  public Iterator getParameterNames() {
-    return data.getParameterNames();
-  }
-
   public void clear()
       throws UploadException,
              IOException {
@@ -1016,7 +1016,7 @@
 
         fos.close();
         is.close();
-        UploadParams uploadParams = new UploadParams(uploadFile.getName(), 
uploadFile.getSize(), uploadFile.getContentType(), 1, storeLocation, 
uploadFileName);
+        UploadParams uploadParams = new UploadParams(uploadFile.getName(), 
uploadFile.getSize(), uploadFile.getContentType(), UploadConstant.DIR, 
storeLocation, uploadFileName);
         history.add(uploadParams);
         notify(uploadParams, uploadFile);
       } else {
@@ -1038,8 +1038,8 @@
       }
 
       UploadStore uploadStore   = UploadStore.getInstance();
-      String      s1            = uploadStore.append(storeLocation, 
uploadFile, maxFileNumber, overwrite);
-      UploadParams uploadParams = new UploadParams(uploadFile.getName(), 
uploadFile.getSize(), uploadFile.getContentType(), 3, storeLocation, s1);
+      String      altFileName   = uploadStore.append(storeLocation, 
uploadFile, maxFileNumber, overwrite);
+      UploadParams uploadParams = new UploadParams(uploadFile.getName(), 
uploadFile.getSize(), uploadFile.getContentType(), UploadConstant.ZIP, 
storeLocation, altFileName);
 
       history.add(uploadParams);
       notify(uploadParams, uploadFile);
@@ -1063,7 +1063,7 @@
       }
 
       storeMemory.add(uploadFile);
-      UploadParams uploadParams = new UploadParams(uploadFile.getName(), 
uploadFile.getSize(), uploadFile.getContentType(), 0, UploadConstant.MEMORY, 
null);
+      UploadParams uploadParams = new UploadParams(uploadFile.getName(), 
uploadFile.getSize(), uploadFile.getContentType(), UploadConstant.MEM, 
UploadConstant.MEMORY, null);
       history.add(uploadParams);
       notify(uploadParams, uploadFile);
     }
@@ -1113,7 +1113,7 @@
     }
     return excluded;
   }
-} 
+}
 }}}
 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to