You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by mi...@apache.org on 2004/09/16 16:54:14 UTC

svn commit: rev 46183 - incubator/lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/authoring

Author: michi
Date: Thu Sep 16 07:54:13 2004
New Revision: 46183

Modified:
   incubator/lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/authoring/UploadHelper.java
Log:
upload filename can be overwritten

Modified: incubator/lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/authoring/UploadHelper.java
==============================================================================
--- incubator/lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/authoring/UploadHelper.java	(original)
+++ incubator/lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/authoring/UploadHelper.java	Thu Sep 16 07:54:13 2004
@@ -7,7 +7,7 @@
  * for the specific language governing permissions and limitations under the License.
  */
 
-/* $Id: UploadHelper.java,v 1.6 2004/08/16 12:11:31 andreas Exp $ */
+/* $Id$ */
 
 package org.apache.lenya.cms.authoring;
 
@@ -25,7 +25,7 @@
  * Helper class for uploading files.
  * @author <a href="mailto:andreas@apache.org">Andreas Hartmann </a>
  * @author <a href="mailto:michi@apache.org">Michael Wechner </a>
- * @version $Id: UploadHelper.java,v 1.6 2004/08/16 12:11:31 andreas Exp $
+ * @version $Id$
  */
 public class UploadHelper {
 
@@ -55,8 +55,16 @@
      * @return <code>true</code> if the upload succeeded, <code>false</code> otherwise.
      */
     public boolean save(Part part) {
-
         File file = new File(directory, part.getFileName());
+        return save(part, file);
+    }
+
+    /**
+     * Save uploaded file
+     * @param part The part of the multipart request.
+     * @return <code>true</code> if the upload succeeded, <code>false</code> otherwise.
+     */
+    public boolean save(Part part, File file) {
         if (log.isDebugEnabled()) {
             log.debug("Uploading file: [" + file.getAbsolutePath() + "]");
         }
@@ -119,4 +127,4 @@
         return file;
     }
 
-}
\ No newline at end of file
+}

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org