public static class HttpRequestOptions.FileStreamField extends Object
File or InputStream.| Constructor and Description |
|---|
FileStreamField(File file)
Constructs the file field wrapper from
File object |
FileStreamField(InputStream stream,
String fileName)
Constructs the file field wrapper from
InputStream and the file name |
| Modifier and Type | Method and Description |
|---|---|
String |
getFileName()
Returns the file name under which the file will be sent in request
|
InputStream |
getStream()
Returns
InputStream with contents of the file |
void |
setFile(File file)
Sets file from
File object |
void |
setFile(InputStream stream,
String fileName)
Sets file from
InputStream object |
public FileStreamField(File file) throws FileNotFoundException
File objectfile - file object which will be sent in requestFileNotFoundException - if file not foundpublic FileStreamField(InputStream stream, String fileName)
InputStream and the file namestream - input stream with contents of the filefileName - file name under which the file will be sentpublic void setFile(File file) throws FileNotFoundException
File objectfile - file object which will be sent in requestFileNotFoundException - if file not foundpublic void setFile(InputStream stream, String fileName)
InputStream objectstream - input stream with contents of the filefileName - file name under which the file will be sentpublic InputStream getStream()
InputStream with contents of the filepublic String getFileName()
Copyright © 2021. All rights reserved.