接口 FilePartEvent
- 所有超级接口:
PartEvent
Represents an event triggered for a file upload. Contains the
filename, besides the headers
and content exposed through
PartEvent.
On the client side, instances of this interface can be created via one of the overloaded create methods.
On the server side, multipart file uploads trigger one or more
FilePartEvent, as described here.
- 从以下版本开始:
- 4.0 2022/4/22 9:13
- 作者:
- Arjen Poutsma, Harry Yang
- 另请参阅:
-
方法概要
修饰符和类型方法说明static reactor.core.publisher.Flux<FilePartEvent>Creates a stream ofFilePartEventobjects based on the given name and resource.static reactor.core.publisher.Flux<FilePartEvent>create(String name, cn.taketoday.core.io.Resource resource, Consumer<HttpHeaders> headersConsumer) Creates a stream ofFilePartEventobjects based on the given name and resource.static reactor.core.publisher.Flux<FilePartEvent>create(String partName, String filename, MediaType contentType, reactor.core.publisher.Flux<cn.taketoday.core.io.buffer.DataBuffer> contents) Creates a stream ofFilePartEventobjects based on the given name, filename(), content-type, and contents.static reactor.core.publisher.Flux<FilePartEvent>create(String partName, String filename, MediaType contentType, reactor.core.publisher.Flux<cn.taketoday.core.io.buffer.DataBuffer> contents, Consumer<HttpHeaders> headersConsumer) Creates a stream ofFilePartEventobjects based on the given name, filename(), content-type, and contents.static reactor.core.publisher.Flux<FilePartEvent>Creates a stream ofFilePartEventobjects based on the given name and file path.static reactor.core.publisher.Flux<FilePartEvent>create(String name, Path path, Consumer<HttpHeaders> headersConsumer) Creates a stream ofFilePartEventobjects based on the given name and file path.default Stringfilename()Return the original filename in the client's filesystem.
-
方法详细资料
-
filename
Return the original filename in the client's filesystem.Note: Please keep in mind this filename is supplied by the client and should not be used blindly. In addition to not using the directory portion, the file name could also contain characters such as ".." and others that can be used maliciously. It is recommended to not use this filename directly. Preferably generate a unique one and save this one somewhere for reference, if necessary.
- 返回:
- the original filename, or the empty String if no file has been chosen
in the multipart form, or
nullif not defined or not available - 另请参阅:
-
create
static reactor.core.publisher.Flux<FilePartEvent> create(String name, cn.taketoday.core.io.Resource resource) Creates a stream ofFilePartEventobjects based on the given name and resource.- 参数:
name- the name of the partresource- the resource- 返回:
- a stream of events
-
create
static reactor.core.publisher.Flux<FilePartEvent> create(String name, cn.taketoday.core.io.Resource resource, @Nullable Consumer<HttpHeaders> headersConsumer) Creates a stream ofFilePartEventobjects based on the given name and resource.- 参数:
name- the name of the partresource- the resourceheadersConsumer- used to change default headers. Can benull.- 返回:
- a stream of events
-
create
Creates a stream ofFilePartEventobjects based on the given name and file path.- 参数:
name- the name of the partpath- the file path- 返回:
- a stream of events
-
create
static reactor.core.publisher.Flux<FilePartEvent> create(String name, Path path, @Nullable Consumer<HttpHeaders> headersConsumer) Creates a stream ofFilePartEventobjects based on the given name and file path.- 参数:
name- the name of the partpath- the file pathheadersConsumer- used to change default headers. Can benull.- 返回:
- a stream of events
-
create
static reactor.core.publisher.Flux<FilePartEvent> create(String partName, String filename, MediaType contentType, reactor.core.publisher.Flux<cn.taketoday.core.io.buffer.DataBuffer> contents) Creates a stream ofFilePartEventobjects based on the given name, filename(), content-type, and contents.- 参数:
partName- the name of the partfilename- the filenamecontentType- the content-type for the contentscontents- the contents- 返回:
- a stream of events
-
create
static reactor.core.publisher.Flux<FilePartEvent> create(String partName, String filename, MediaType contentType, reactor.core.publisher.Flux<cn.taketoday.core.io.buffer.DataBuffer> contents, @Nullable Consumer<HttpHeaders> headersConsumer) Creates a stream ofFilePartEventobjects based on the given name, filename(), content-type, and contents.- 参数:
partName- the name of the partfilename- the filenamecontentType- the content-type for the contentscontents- the contentsheadersConsumer- used to change default headers. Can benull.- 返回:
- a stream of events
-