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 classNested 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()longGets the size of the configured file (in bytes).okhttp3.MediaTypeGets the content type formatted as aMediaType.Gets the content type formatted as a string.voidwriteTo(@NonNull okio.BufferedSink outputBufferedSink) Writes the configuredfileto 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:
contentTypein 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:
contentLengthin classokhttp3.RequestBody- Returns:
- the size in bytes
-
writeTo
Writes the configuredfileto the givenoutputBufferedSink. This is typically a wrapped output stream for the request body.- Specified by:
writeToin classokhttp3.RequestBody- Parameters:
outputBufferedSink- the sink to stream the file contents to- Throws:
IOException- if an error occurred while reading the configured file
-
builder
-