public class FilesystemCacheUploadService extends Object
An upload service implementation that stores temporary upload data in the filesystem.
Constructor and Description |
---|
FilesystemCacheUploadService(String baseDirectoryPath,
long maxFileSize,
long cleanupIntervalMs)
Constructs a new instance.
|
Modifier and Type | Method and Description |
---|---|
int |
cleanup()
Performs periodic cleanup of stale uploads.
|
int |
getActiveUploadCount()
Returns the count of active uploads in the cache.
|
UploadResponse |
upload(org.springframework.web.multipart.MultipartHttpServletRequest uploadRequest,
UploadCompletionHandler completionHandler,
boolean failOnEmptyRequest)
Handles a single content upload request.
|
public FilesystemCacheUploadService(String baseDirectoryPath, long maxFileSize, long cleanupIntervalMs)
Constructs a new instance.
baseDirectoryPath
- the base directory in which the upload cache will be placedmaxFileSize
- the maximum permitted file size (-1 if there is no limit)cleanupIntervalMs
- the interval after which stale upload files will be deleted (in ms)public int getActiveUploadCount()
Returns the count of active uploads in the cache.
public int cleanup()
UploadService
Performs periodic cleanup of stale uploads.
public UploadResponse upload(org.springframework.web.multipart.MultipartHttpServletRequest uploadRequest, UploadCompletionHandler completionHandler, boolean failOnEmptyRequest)
UploadService
Handles a single content upload request.
The request may be either a complete upload in a single request or part of a chunked upload. The completion handler will only be called when the complete content is available on the server.
upload
in interface UploadService
uploadRequest
- the incoming content upload requestcompletionHandler
- the handler to be called when the content is completefailOnEmptyRequest
- fail is a request is received with no contentCopyright © 2010 - 2019 edorasware ag. All Rights Reserved.