public class FileResult
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getContent()
Get content stream from this file.
|
java.io.InputStream |
openRead()
Opens a stream for this file.
|
void |
writeTo(java.io.OutputStream outStream)
Writes this file content to a output stream.
|
void |
writeToFile(java.nio.file.Path path)
Write this file content in some file which has the provided path.
|
void |
writeToFile(java.lang.String path)
Write this file content in some file which has the provided path.
|
public java.io.InputStream openRead()
throws RestException
RestException - if an error occurs when trying to get the file from a url.public void writeTo(java.io.OutputStream outStream)
throws RestException,
java.io.IOException
outStream - output streamRestExceptionjava.io.IOExceptionpublic void writeToFile(java.nio.file.Path path)
throws RestException,
java.io.IOException
RestException - if an error occurs when trying to get the file from a url.java.io.IOException - if an error occurs when trying to create or open the destination file.public void writeToFile(java.lang.String path)
throws RestException,
java.io.IOException
path - Path of file that will be written.RestException - if an error occurs when trying to get the file from a url.java.io.IOException - if an error occurs when trying to create or open the destination file.public byte[] getContent()
throws RestException,
java.io.IOException
RestException - if an error occurs when trying to get the file from a url.java.io.IOException