public interface FileUpload extends Value
MediaType.MULTIPART_FORMDATA
. Example:
{
post("/submit", ctx -> {
FileUpload file = ctx.file("myfile");
});
}
Modifier and Type | Method and Description |
---|---|
byte[] |
bytes()
Content as byte array.
|
void |
destroy()
Free resources, delete temporary file.
|
default FileUpload |
fileUpload()
Get a file upload from this value.
|
default Value |
get(int index)
Get a value at the given position.
|
default Value |
get(String name)
Get a value that matches the given name.
|
String |
getContentType()
Content type of file upload.
|
String |
getFileName()
Name of file upload.
|
long |
getFileSize()
File size.
|
Path |
path()
File system path to access file content.
|
default int |
size()
The number of values this one has.
|
InputStream |
stream()
Content as input stream.
|
default Map<String,List<String>> |
toMultimap()
Multi-value map with field name as key and file name as values.
|
default String |
value()
Get string value.
|
default String |
value(Charset charset)
File upload content as string.
|
array, booleanValue, booleanValue, byteValue, byteValue, create, create, doubleValue, doubleValue, floatValue, floatValue, hash, intValue, intValue, isArray, isMissing, isObject, isSingle, isUpload, iterator, longValue, longValue, missing, name, resolve, resolve, resolve, resolve, to, to, to, toEnum, toEnum, toList, toList, toMap, toOptional, toOptional, toSet, toSet, value, value, value, valueOrNull
forEach, spliterator
@Nullable String getContentType()
default Value get(@Nonnull int index)
Value
default Value get(@Nonnull String name)
Value
default int size()
Value
0
.@Nonnull default String value(@Nonnull Charset charset)
charset
- Charset.@Nonnull default Map<String,List<String>> toMultimap()
toMultimap
in interface Value
@Nonnull InputStream stream()
@Nonnull byte[] bytes()
@Nonnull Path path()
long getFileSize()
default FileUpload fileUpload()
Value
fileUpload
in interface Value
void destroy()
Copyright © 2019. All rights reserved.