public abstract class FileUploadDirectives extends FileAndResourceDirectives
Constructor and Description |
---|
FileUploadDirectives() |
Modifier and Type | Method and Description |
---|---|
Route |
fileUpload(java.lang.String fieldName,
java.util.function.BiFunction<FileInfo,org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,java.lang.Object>,Route> inner)
Collects each body part that is a multipart file as a tuple containing metadata and a
Source
for streaming the file contents somewhere. |
Route |
fileUploadAll(java.lang.String fieldName,
java.util.function.Function<java.util.List<java.util.Map.Entry<FileInfo,org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,java.lang.Object>>>,Route> inner)
Collects each body part that is a multipart file as a tuple containing metadata and a
Source
for streaming the file contents somewhere. |
Route |
storeUploadedFile(java.lang.String fieldName,
java.util.function.Function<FileInfo,java.io.File> destFn,
java.util.function.BiFunction<FileInfo,java.io.File,Route> inner)
Streams the bytes of the file submitted using multipart with the given file name into a designated file on disk.
|
Route |
storeUploadedFiles(java.lang.String fieldName,
java.util.function.Function<FileInfo,java.io.File> destFn,
java.util.function.Function<java.util.List<java.util.Map.Entry<FileInfo,java.io.File>>,Route> inner)
Streams the bytes of the file submitted using multipart with the given field name into designated files on disk.
|
defaultContentTypeResolver, defaultDirectoryRenderer, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromDirectory, getFromDirectory, getFromFile, getFromFile, getFromFile, getFromFile, getFromFile, getFromResource, getFromResource, getFromResource, getFromResource, getFromResourceDirectory, getFromResourceDirectory, getFromResourceDirectory, getFromResourceDirectory, listDirectoryContents, listDirectoryContents, listDirectoryContents, listDirectoryContents
handleExceptions, handleRejections
logRequest, logRequest, logRequest, logRequestResult, logRequestResultOptional, logResult, logResult, logResult
cookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, optionalCookie, setCookie, setCookie
decodeRequest, decodeRequestWith, decodeRequestWith, encodeResponse, encodeResponseWith, requestEncodedWith, responseEncodingAccepted, withPrecompressedMediaTypeSupport
conditional, conditional, conditional, conditional
cancelRejection, cancelRejections, cancelRejections, extract, extractActorSystem, extractDataBytes, extractEntity, extractExecutionContext, extractLog, extractMatchedPath, extractMaterializer, extractParserSettings, extractRequest, extractRequestContext, extractRequestEntity, extractSettings, extractStrictEntity, extractStrictEntity, extractUnmatchedPath, extractUri, mapInnerRoute, mapRejections, mapRequest, mapRequestContext, mapResponse, mapResponseEntity, mapResponseHeaders, mapRouteResult, mapRouteResultFuture, mapRouteResultPF, mapRouteResultWith, mapRouteResultWithPF, mapSettings, mapUnmatchedPath, pass, provide, recoverRejections, recoverRejectionsWith, toStrictEntity, toStrictEntity, withExecutionContext, withLog, withMaterializer, withSettings
public Route fileUpload(java.lang.String fieldName, java.util.function.BiFunction<FileInfo,org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,java.lang.Object>,Route> inner)
Source
for streaming the file contents somewhere. If there is no such field the request will be rejected,
if there are multiple file parts with the same name, the first one will be used and the subsequent
ones ignored.fieldName
- (undocumented)inner
- (undocumented)public Route fileUploadAll(java.lang.String fieldName, java.util.function.Function<java.util.List<java.util.Map.Entry<FileInfo,org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,java.lang.Object>>>,Route> inner)
Source
for streaming the file contents somewhere. If there is no such field the request will be rejected.
Files are buffered into temporary files on disk so in-memory buffers don't overflow. The temporary
files are cleaned up once materialized, or on exit if the stream is not consumed.fieldName
- (undocumented)inner
- (undocumented)public Route storeUploadedFile(java.lang.String fieldName, java.util.function.Function<FileInfo,java.io.File> destFn, java.util.function.BiFunction<FileInfo,java.io.File,Route> inner)
fieldName
- (undocumented)destFn
- (undocumented)inner
- (undocumented)public Route storeUploadedFiles(java.lang.String fieldName, java.util.function.Function<FileInfo,java.io.File> destFn, java.util.function.Function<java.util.List<java.util.Map.Entry<FileInfo,java.io.File>>,Route> inner)
fieldName
- (undocumented)destFn
- (undocumented)inner
- (undocumented)