org.apache.turbine.services.upload
Class BaseUploadService
java.lang.Object
|
+--org.apache.turbine.services.BaseInitable
|
+--org.apache.turbine.services.BaseService
|
+--org.apache.turbine.services.TurbineBaseService
|
+--org.apache.turbine.services.upload.BaseUploadService
- All Implemented Interfaces:
- Initable, Service, UploadService
- Direct Known Subclasses:
- FileHandlerUploadService, OReillyUploadService, TurbineUploadService
- public abstract class BaseUploadService
- extends TurbineBaseService
- implements UploadService
This class is a base implementation of
UploadService
.
- Version:
- $Id: BaseUploadService.java,v 1.1.1.1 2001/08/16 05:09:23 jvanzyl Exp $
- Author:
- Rafal Krzewski, Daniel Rall, Jon S. Stevens
Field Summary |
static int |
MAX_HEADER_SIZE
A maximum lenght of a single header line that will be
parsed. |
Fields inherited from interface org.apache.turbine.services.upload.UploadService |
AUTOMATIC_DEFAULT, AUTOMATIC_KEY, CONTENT_DISPOSITION, CONTENT_TYPE, FORM_DATA, MIXED, MULTIPART, MULTIPART_FORM_DATA, MULTIPART_MIXED, REPOSITORY_DEFAULT, REPOSITORY_KEY, REPOSITORY_PARAMETER, SERVICE_NAME, SIZE_MAX_DEFAULT, SIZE_MAX_KEY, SIZE_THRESHOLD_DEFAULT, SIZE_THRESHOLD_KEY |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAX_HEADER_SIZE
public static final int MAX_HEADER_SIZE
- A maximum lenght of a single header line that will be
parsed. (1024 bytes).
BaseUploadService
public BaseUploadService()
init
public void init()
- Initializes the service.
This method processes the repository path, to make it relative to the
web application root, if neccessary
- Specified by:
init
in interface Initable
- Overrides:
init
in class TurbineBaseService
- Following copied from interface:
org.apache.turbine.services.Initable
- Throws:
InitializationException,
- if initialization of this
class was not successful.
parseRequest
public abstract void parseRequest(javax.servlet.http.HttpServletRequest req,
ParameterParser params,
java.lang.String path)
throws TurbineException
Processes an RFC
1867 compliant multipart/form-data
stream.
- Specified by:
parseRequest
in interface UploadService
- 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:
TurbineException
- 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
.
- Specified by:
getSizeMax
in interface UploadService
- Returns:
- The maximum upload size.
getSizeThreshold
public int getSizeThreshold()
Retrieves the value of size.threshold
property of
UploadService
.
- Specified by:
getSizeThreshold
in interface 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
.
- Specified by:
getRepository
in interface UploadService
- Returns:
- The repository.
Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.