Class FileBodyGenerator
- java.lang.Object
-
- org.asynchttpclient.request.body.generator.FileBodyGenerator
-
- All Implemented Interfaces:
BodyGenerator
public final class FileBodyGenerator extends Object implements BodyGenerator
Creates a request body from the contents of a file.
-
-
Constructor Summary
Constructors Constructor Description FileBodyGenerator(File file)
FileBodyGenerator(File file, long regionSeek, long regionLength)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RandomAccessBody
createBody()
Creates a new instance of the request body to be read.File
getFile()
long
getRegionLength()
long
getRegionSeek()
-
-
-
Method Detail
-
getFile
public File getFile()
-
getRegionLength
public long getRegionLength()
-
getRegionSeek
public long getRegionSeek()
-
createBody
public RandomAccessBody createBody()
Description copied from interface:BodyGenerator
Creates a new instance of the request body to be read. While each invocation of this method is supposed to create a fresh instance of the body, the actual contents of all these body instances is the same. For example, the body needs to be resend after an authentication challenge of a redirect.- Specified by:
createBody
in interfaceBodyGenerator
- Returns:
- The request body, never
null
.
-
-