org.apache.cocoon.servlet.multipart
Class MultipartConfigurationHelper

java.lang.Object
  extended byorg.apache.cocoon.servlet.multipart.MultipartConfigurationHelper

public class MultipartConfigurationHelper
extends Object

Configuration object for the multipart filter.

Since:
2.2
Version:
$Id: MultipartConfigurationHelper.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Field Summary
protected  boolean autosaveUploads
          Causes all files in multipart requests to be saved to upload-dir.
static boolean ENABLE_UPLOADS
           
protected  boolean enableUploads
          Causes all files in multipart requests to be processed.
static int MAX_UPLOAD_SIZE
           
protected  int maxUploadSize
          Specify maximum allowed size of the upload.
protected  String overwriteUploads
          Specify handling of name conflicts when saving uploaded files to disk.
static boolean SAVE_UPLOADS_TO_DISK
           
protected  String uploadDirectory
          This parameter allows to specify where Cocoon should put uploaded files.
 
Constructor Summary
MultipartConfigurationHelper()
           
 
Method Summary
 void configure(org.apache.cocoon.configuration.Settings settings, Log logger)
          Configure this from the settings object.
 int getMaxUploadSize()
           
 String getOverwriteUploads()
           
 String getUploadDirectory()
           
 boolean isAllowOverwrite()
           
 boolean isAutosaveUploads()
           
 boolean isEnableUploads()
           
 boolean isSilentlyRename()
           
 void setAutosaveUploads(boolean autosaveUploadsValue)
           
 void setEnableUploads(boolean enableUploads)
           
 void setMaxUploadSize(int maxUploadSize)
           
 void setOverwriteUploads(String overwriteUploads)
           
 void setUploadDirectory(String uploadDirectory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENABLE_UPLOADS

public static final boolean ENABLE_UPLOADS
See Also:
Constant Field Values

SAVE_UPLOADS_TO_DISK

public static final boolean SAVE_UPLOADS_TO_DISK
See Also:
Constant Field Values

MAX_UPLOAD_SIZE

public static final int MAX_UPLOAD_SIZE
See Also:
Constant Field Values

enableUploads

protected boolean enableUploads
Causes all files in multipart requests to be processed. Default is false for security reasons.


uploadDirectory

protected String uploadDirectory
This parameter allows to specify where Cocoon should put uploaded files. The path specified can be either absolute or relative to the context path of the servlet. On windows platform, absolute directory must start with volume: C:\Path\To\Upload\Directory.


autosaveUploads

protected boolean autosaveUploads
Causes all files in multipart requests to be saved to upload-dir. Default is true for security reasons.


overwriteUploads

protected String overwriteUploads
Specify handling of name conflicts when saving uploaded files to disk. Acceptable values are deny, allow, rename (default). Files are renamed x_filename where x is an integer value incremented to make the new filename unique.


maxUploadSize

protected int maxUploadSize
Specify maximum allowed size of the upload. Defaults to 10 Mb.

Constructor Detail

MultipartConfigurationHelper

public MultipartConfigurationHelper()
Method Detail

configure

public void configure(org.apache.cocoon.configuration.Settings settings,
                      Log logger)
Configure this from the settings object.

Parameters:
settings -

isAutosaveUploads

public boolean isAutosaveUploads()
Returns:
Returns the autosaveUploads.
See Also:
#KEY_UPLOADS_AUTOSAVE

isEnableUploads

public boolean isEnableUploads()
Returns:
Returns the enableUploads.
See Also:
#KEY_UPLOADS_ENABLE

getMaxUploadSize

public int getMaxUploadSize()
Returns:
Returns the maxUploadSize.
See Also:
#KEY_UPLOADS_MAXSIZE

getOverwriteUploads

public String getOverwriteUploads()
Returns:
Returns the overwriteUploads.
See Also:
#KEY_UPLOADS_OVERWRITE

getUploadDirectory

public String getUploadDirectory()
Returns:
Returns the uploadDirectory.
See Also:
#KEY_UPLOADS_DIRECTORY

isAllowOverwrite

public boolean isAllowOverwrite()

isSilentlyRename

public boolean isSilentlyRename()

setAutosaveUploads

public void setAutosaveUploads(boolean autosaveUploadsValue)
Parameters:
autosaveUploadsValue - The autosaveUploads to set.

setEnableUploads

public void setEnableUploads(boolean enableUploads)
Parameters:
enableUploads - The enableUploads to set.

setMaxUploadSize

public void setMaxUploadSize(int maxUploadSize)
Parameters:
maxUploadSize - The maxUploadSize to set.

setOverwriteUploads

public void setOverwriteUploads(String overwriteUploads)
Parameters:
overwriteUploads - The overwriteUploads to set.

setUploadDirectory

public void setUploadDirectory(String uploadDirectory)
Parameters:
uploadDirectory - The uploadDirectory to set.


Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.