Interface FileUploadDirectives
-
- All Known Subinterfaces:
Directives
- All Known Implementing Classes:
Directives$
,FileUploadDirectives$
,HttpApp
public interface FileUploadDirectives
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Directive<scala.Tuple1<scala.Tuple2<FileInfo,akka.stream.scaladsl.Source<akka.util.ByteString,java.lang.Object>>>>
fileUpload(java.lang.String fieldName)
Collects each body part that is a multipart file as a tuple containing metadata and aSource
for streaming the file contents somewhere.Directive<scala.Tuple1<scala.collection.immutable.Seq<scala.Tuple2<FileInfo,akka.stream.scaladsl.Source<akka.util.ByteString,java.lang.Object>>>>>
fileUploadAll(java.lang.String fieldName)
Collects each body part that is a multipart file as a tuple containing metadata and aSource
for streaming the file contents somewhere.Directive<scala.Tuple2<FileInfo,java.io.File>>
storeUploadedFile(java.lang.String fieldName, scala.Function1<FileInfo,java.io.File> destFn)
Streams the bytes of the file submitted using multipart with the given file name into a designated file on disk.Directive<scala.Tuple1<scala.collection.immutable.Seq<scala.Tuple2<FileInfo,java.io.File>>>>
storeUploadedFiles(java.lang.String fieldName, scala.Function1<FileInfo,java.io.File> destFn)
Streams the bytes of the file submitted using multipart with the given field name into designated files on disk.
-
-
-
Method Detail
-
storeUploadedFile
Directive<scala.Tuple2<FileInfo,java.io.File>> storeUploadedFile(java.lang.String fieldName, scala.Function1<FileInfo,java.io.File> destFn)
Streams the bytes of the file submitted using multipart with the given file name into a designated file on disk. If there is an error writing to disk the request will be failed with the thrown exception, 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.- Parameters:
fieldName
- (undocumented)destFn
- (undocumented)- Returns:
- (undocumented)
-
storeUploadedFiles
Directive<scala.Tuple1<scala.collection.immutable.Seq<scala.Tuple2<FileInfo,java.io.File>>>> storeUploadedFiles(java.lang.String fieldName, scala.Function1<FileInfo,java.io.File> destFn)
Streams the bytes of the file submitted using multipart with the given field name into designated files on disk. If there is an error writing to disk the request will be failed with the thrown exception, if there is no such field the request will be rejected. Stored files are cleaned up on exit but not on failure.- Parameters:
fieldName
- (undocumented)destFn
- (undocumented)- Returns:
- (undocumented)
-
fileUpload
Directive<scala.Tuple1<scala.Tuple2<FileInfo,akka.stream.scaladsl.Source<akka.util.ByteString,java.lang.Object>>>> fileUpload(java.lang.String fieldName)
Collects each body part that is a multipart file as a tuple containing metadata and aSource
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.- Parameters:
fieldName
- (undocumented)- Returns:
- (undocumented)
-
fileUploadAll
Directive<scala.Tuple1<scala.collection.immutable.Seq<scala.Tuple2<FileInfo,akka.stream.scaladsl.Source<akka.util.ByteString,java.lang.Object>>>>> fileUploadAll(java.lang.String fieldName)
Collects each body part that is a multipart file as a tuple containing metadata and aSource
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.- Parameters:
fieldName
- (undocumented)- Returns:
- (undocumented)
-
-