svn commit: r1412694 - /cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java

[email protected]
Newsgroups gmane.text.xml.cocoon.cvs
Message-ID <[email protected]>
Author: cdamioli
Date: Thu Nov 22 22:25:06 2012
New Revision: 1412694

URL: http://svn.apache.org/viewvc?rev=1412694&view=rev
Log:
COCOON-2314 Allow to override the upload parameters in CocoonServlet 

Modified:
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java?rev=1412694&r1=1412693&r2=1412694&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/servlet/CocoonServlet.java Thu Nov 22 22:25:06 2012
@@ -177,17 +177,17 @@ public class CocoonServlet extends HttpS
     /**
      * Allow processing of upload requests (mime/multipart)
      */
-    private boolean enableUploads;
-    private boolean autoSaveUploads;
-    private boolean allowOverwrite;
-    private boolean silentlyRename;
-    private int maxUploadSize;
-
-    private File uploadDir;
-    private File workDir;
-    private File cacheDir;
-    private String containerEncoding;
-    private String defaultFormEncoding;
+    protected boolean enableUploads;
+    protected boolean autoSaveUploads;
+    protected boolean allowOverwrite;
+    protected boolean silentlyRename;
+    protected int maxUploadSize;
+
+    protected File uploadDir;
+    protected File workDir;
+    protected File cacheDir;
+    protected String containerEncoding;
+    protected String defaultFormEncoding;
 
     protected ServletContext servletContext;
 
@@ -488,18 +488,26 @@ public class CocoonServlet extends HttpS
 
         this.enableInstrumentation = getInitParameterAsBoolean("enable-instrumentation", false);
 
-        this.requestFactory = new RequestFactory(this.autoSaveUploads,
-                                                 this.uploadDir,
-                                                 this.allowOverwrite,
-                                                 this.silentlyRename,
-                                                 this.maxUploadSize,
-                                                 this.containerEncoding);
+        createRequestFactory();
+
         // Add the servlet configuration
         this.appContext.put(CONTEXT_SERVLET_CONFIG, conf);
         this.createCocoon();
     }
 
     /**
+     * Creates the {@link RequestFactory}.
+     */
+    protected void createRequestFactory(){
+        this.requestFactory = new RequestFactory(this.autoSaveUploads,
+                this.uploadDir,
+                this.allowOverwrite,
+                this.silentlyRename,
+                this.maxUploadSize,
+                this.containerEncoding);
+    }
+
+    /**
      * Dispose Cocoon when servlet is destroyed
      */
     public void destroy() {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.