Class ProgressReportingFileRequestBody
java.lang.Object
okhttp3.RequestBody
com.amilesend.onedrive.connection.file.ProgressReportingFileRequestBody
public class ProgressReportingFileRequestBody
extends okhttp3.RequestBody
A customized implementation of
RequestBody
that invokes a TransferProgressCallback
to notify
of transfer updates for file uploads.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Nested classes/interfaces inherited from class okhttp3.RequestBody
okhttp3.RequestBody.Companion
-
Field Summary
Fields inherited from class okhttp3.RequestBody
Companion, EMPTY
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
long
Gets the size of the configured file (in bytes).okhttp3.MediaType
Gets the content type formatted as aMediaType
.Gets the content type formatted as a string.void
writeTo
(@NonNull okio.BufferedSink outputBufferedSink) Writes the configuredfile
to the givenoutputBufferedSink
.Methods inherited from class okhttp3.RequestBody
create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, isDuplex, isOneShot
-
Method Details
-
contentType
public okhttp3.MediaType contentType()Gets the content type formatted as aMediaType
.- Specified by:
contentType
in classokhttp3.RequestBody
- Returns:
- the content type
-
getContentTypeStringValue
Gets the content type formatted as a string.- Returns:
- the content type
-
contentLength
public long contentLength()Gets the size of the configured file (in bytes).- Overrides:
contentLength
in classokhttp3.RequestBody
- Returns:
- the size in bytes
-
writeTo
Writes the configuredfile
to the givenoutputBufferedSink
. This is typically a wrapped output stream for the request body.- Specified by:
writeTo
in classokhttp3.RequestBody
- Parameters:
outputBufferedSink
- the sink to stream the file contents to- Throws:
IOException
- if an error occurred while reading the configured file
-
builder
-