EchoPoint API - 3.0.0b5
App Webcontainer

echopoint.tucana
Interface UploadSPI

All Superinterfaces:
WebContainerServlet.MultipartRequestWrapper
All Known Implementing Classes:
AbstractFileUploadProvider, JakartaCommonsFileUploadProvider

public interface UploadSPI
extends WebContainerServlet.MultipartRequestWrapper

Service provider interface (SPI) which allows pluggable selection of the library to be used to parse file uploads from HttpServletRequest.

Custom UploadSPI implementations may be configured by calling UploadProviderFactory.setUploadProvider(UploadSPI) from within an application entry point.

Version:
$Id: UploadSPI.java 90 2008-11-11 01:41:05Z sptrakesh $
Author:
Echo File Transfer Library

Field Summary
static short NO_SIZE_LIMIT
          Constant indicating that there is no size limit.
 
Method Summary
 File getDiskCacheLocation()
          Gets the directory to be used for storing file uploads that exceed the memory cache threshold.
 long getFileUploadSizeLimit()
          Gets the maximum size, in bytes, of file uploads to be accepted.
 int getMemoryCacheThreshold()
          Gets the size, in bytes, that the file upload must exceed before being cached to disk rather than in-memory.
 void handleUpload(Connection conn, FileUploadSelector uploadSelect, String uploadIndex, UploadProgress progress)
          Handles the upload of a file.
 
Methods inherited from interface nextapp.echo.webcontainer.WebContainerServlet.MultipartRequestWrapper
getWrappedRequest
 

Field Detail

NO_SIZE_LIMIT

static final short NO_SIZE_LIMIT
Constant indicating that there is no size limit.

See Also:
Constant Field Values
Method Detail

getDiskCacheLocation

File getDiskCacheLocation()
                          throws IOException
Gets the directory to be used for storing file uploads that exceed the memory cache threshold. Implementations should ensure that the returned location exists. Implementations that do not support this should ignore calls to this method.

Returns:
location to store uploaded files.
Throws:
IOException - if an I/O error occurs during this operation

getFileUploadSizeLimit

long getFileUploadSizeLimit()
Gets the maximum size, in bytes, of file uploads to be accepted. Uploads that exceed the specified size are terminated or handled in a manner that minimizes the risk of a Denial of Service attack against the application. Implementations that do not impose a size limit should return NO_SIZE_LIMIT.

Returns:
the size threshold after which a file upload is rejected or NO_SIZE_LIMIT if there is no size limit.

getMemoryCacheThreshold

int getMemoryCacheThreshold()
Gets the size, in bytes, that the file upload must exceed before being cached to disk rather than in-memory. Implementations that do not support this should ignore calls to this method.

Returns:
the maximum size in bytes of the file upload before it will be cached to disk.

handleUpload

void handleUpload(Connection conn,
                  FileUploadSelector uploadSelect,
                  String uploadIndex,
                  UploadProgress progress)
                  throws Exception
Handles the upload of a file.

Parameters:
conn - provides access to the request and response objects
uploadSelect - provides access to additional settings
uploadIndex - the upload index
progress - used to communicate progress
Throws:
Exception - If errors are encountered.

EchoPoint API - 3.0.0b5
App Webcontainer