org.apache.turbine.services.upload
Interface UploadService

All Superinterfaces:
Initable, Service
All Known Implementing Classes:
BaseUploadService

public interface UploadService
extends Service

This service handles parsing multipart/form-data POST requests and turing them into form fields and uploaded files. This can be either performed automatically by the ParameterParser or manually by an user definded Action.

Version:
$Id: UploadService.java,v 1.1.1.1 2001/08/16 05:09:25 jvanzyl Exp $
Author:
Rafal Krzewski, Daniel Rall

Field Summary
static java.lang.Boolean AUTOMATIC_DEFAULT
           The default value of 'automatic' property (false).
static java.lang.String AUTOMATIC_KEY
          The key in UploadService properties in TurbineResources.properties 'automatic' property.
static java.lang.String CONTENT_DISPOSITION
          HTTP header.
static java.lang.String CONTENT_TYPE
          HTTP header.
static java.lang.String FORM_DATA
          HTTP header base type modifier.
static java.lang.String MIXED
          HTTP header base type modifier.
static java.lang.String MULTIPART
          HTTP header base type.
static java.lang.String MULTIPART_FORM_DATA
          HTTP header.
static java.lang.String MULTIPART_MIXED
          HTTP header.
static java.lang.String REPOSITORY_DEFAULT
           The default value of 'repository' property (.).
static java.lang.String REPOSITORY_KEY
          The key in UploadService properties in TurbineResources.properties 'repository' property.
static java.lang.String REPOSITORY_PARAMETER
          The request parameter name for overriding 'repository' property (path).
static java.lang.String SERVICE_NAME
          The key in the TurbineResources.properties that references this service.
static java.lang.Integer SIZE_MAX_DEFAULT
           The default value of 'size.max' property (1 megabyte = 1048576 bytes).
static java.lang.String SIZE_MAX_KEY
          w The key in UploadService properties in TurbineResources.properties 'size.max' property.
static java.lang.Integer SIZE_THRESHOLD_DEFAULT
           The default value of 'size.threshold' property (10 kilobytes = 10240 bytes).
static java.lang.String SIZE_THRESHOLD_KEY
          The key in UploadService properties in TurbineResources.properties 'size.threshold' property.
 
Method Summary
 java.lang.String getRepository()
           Retrieves the value of the repository property of UploadService.
 int getSizeMax()
           Retrieves the value of size.max property of the UploadService.
 int getSizeThreshold()
           Retrieves the value of size.threshold property of UploadService.
 void parseRequest(javax.servlet.http.HttpServletRequest req, ParameterParser params, java.lang.String path)
           This method performs parsing the request, and storing the acquired information in apropriate places.
 
Methods inherited from interface org.apache.turbine.services.Service
getConfiguration, getName, getProperties, setName, setServiceBroker
 
Methods inherited from interface org.apache.turbine.services.Initable
getInit, init, init, setInitableBroker, shutdown
 

Field Detail

CONTENT_TYPE

public static final java.lang.String CONTENT_TYPE
HTTP header.

CONTENT_DISPOSITION

public static final java.lang.String CONTENT_DISPOSITION
HTTP header.

MULTIPART

public static final java.lang.String MULTIPART
HTTP header base type.

FORM_DATA

public static final java.lang.String FORM_DATA
HTTP header base type modifier.

MIXED

public static final java.lang.String MIXED
HTTP header base type modifier.

MULTIPART_FORM_DATA

public static final java.lang.String MULTIPART_FORM_DATA
HTTP header.

MULTIPART_MIXED

public static final java.lang.String MULTIPART_MIXED
HTTP header.

SERVICE_NAME

public static final java.lang.String SERVICE_NAME
The key in the TurbineResources.properties that references this service.

AUTOMATIC_KEY

public static final java.lang.String AUTOMATIC_KEY
The key in UploadService properties in TurbineResources.properties 'automatic' property.

AUTOMATIC_DEFAULT

public static final java.lang.Boolean AUTOMATIC_DEFAULT

The default value of 'automatic' property (false). If set to true, parsing the multipart request will be performed automaticaly by ParameterParser. Otherwise, an Action may decide to to parse the request by calling parseRequest manually.


REPOSITORY_PARAMETER

public static final java.lang.String REPOSITORY_PARAMETER
The request parameter name for overriding 'repository' property (path).

REPOSITORY_KEY

public static final java.lang.String REPOSITORY_KEY
The key in UploadService properties in TurbineResources.properties 'repository' property.

REPOSITORY_DEFAULT

public static final java.lang.String REPOSITORY_DEFAULT

The default value of 'repository' property (.). This is the directory where uploaded fiels will get stored temporarily. Note that "." is whatever the servlet container chooses to be it's 'current directory'.


SIZE_MAX_KEY

public static final java.lang.String SIZE_MAX_KEY
w The key in UploadService properties in TurbineResources.properties 'size.max' property.

SIZE_MAX_DEFAULT

public static final java.lang.Integer SIZE_MAX_DEFAULT

The default value of 'size.max' property (1 megabyte = 1048576 bytes). This is the maximum size of POST request that will be parsed by the uploader. If you need to set specific limits for your users, set this property to the largest limit value, and use an action + no auto upload to enforce limits.


SIZE_THRESHOLD_KEY

public static final java.lang.String SIZE_THRESHOLD_KEY
The key in UploadService properties in TurbineResources.properties 'size.threshold' property.

SIZE_THRESHOLD_DEFAULT

public static final java.lang.Integer SIZE_THRESHOLD_DEFAULT

The default value of 'size.threshold' property (10 kilobytes = 10240 bytes). This is the maximum size of a POST request that will have it's components stored temporarily in memory, instead of disk.

Method Detail

parseRequest

public void parseRequest(javax.servlet.http.HttpServletRequest req,
                         ParameterParser params,
                         java.lang.String path)
                  throws TurbineException

This method performs parsing the request, and storing the acquired information in apropriate places.

Parameters:
req - The servlet request to be parsed.
params - The ParameterParser instance to insert form fields into.
path - The location where the files should be stored.
Throws:
IOException, - if there are problems reading/parsing the request or storing files.

getSizeMax

public int getSizeMax()

Retrieves the value of size.max property of the UploadService.

Returns:
The maximum upload size.

getSizeThreshold

public int getSizeThreshold()

Retrieves the value of size.threshold property of UploadService.

Returns:
The threshold beyond which files are written directly to disk.

getRepository

public java.lang.String getRepository()

Retrieves the value of the repository property of UploadService.

Returns:
The repository.


Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.