Class Info |
|---|
public final class MediaHttpUploader MediaHttpUploader class. |
Constructor Name |
|---|
MediaHttpUploader(AbstractInputStreamContent mediaContent, HttpTransport transport, HttpRequestInitializer httpRequestInitializer) Constructs a MediaHttpUploader object. |
Qualifier and Type | Method Name and Description |
|---|---|
double | Obtains the upload progress indicating the percentage of bytes that have been uploaded. The value ranges from 0.0 (0%) to 1.0 (100%). |
MediaHttpUploaderProgressListener | Obtains the progress listener. |
long | Obtains the total upload time. |
UploadState | Obtains the current upload status of the uploader. |
MediaHttpUploader | setDirectUploadEnabled(boolean directUploadEnabled) Sets whether to enable direct upload. |
MediaHttpUploader | setProgressListener(MediaHttpUploaderProgressListener progressListener) Sets the progress listener to send progress notifications. |
Constructor |
|---|
public MediaHttpUploader(AbstractInputStreamContent mediaContent, HttpTransport transport, HttpRequestInitializer httpRequestInitializer) Constructs a MediaHttpUploader object. |
Parameters
Name | Description |
|---|---|
mediaContent | Input stream content of the media to be uploaded. |
transport | HttpTransport to use for requests. |
httpRequestInitializer | Initializer to use when creating an HTTP request, which can be null. |
Method |
|---|
public MediaHttpUploader setDirectUploadEnabled(boolean directUploadEnabled) Sets whether to enable direct upload. |
Parameters
Name | Description |
|---|---|
directUploadEnabled | Indicates whether to enable direct upload. true: Yes. The entire media data will be uploaded in a single request. false: No. The media data will be uploaded in data chunks using the protocol of resumable media upload. |
Returns
Type | Description |
|---|---|
MediaHttpUploader | A MediaHttpUploader object. |
Method |
|---|
public MediaHttpUploader setProgressListener(MediaHttpUploaderProgressListener progressListener) Sets the progress listener to send progress notifications. |
Parameters
Name | Description |
|---|---|
progressListener | Progress listener. |
Returns
Type | Description |
|---|---|
MediaHttpUploader | A MediaHttpUploader object. |
Method |
|---|
public MediaHttpUploaderProgressListener getProgressListener() Obtains the progress listener. |
Returns
Type | Description |
|---|---|
A MediaHttpUploaderProgressListener object. |
Method |
|---|
double getProgress() Obtains the upload progress indicating the percentage of bytes that have been uploaded. The value ranges from 0.0 (0%) to 1.0 (100%). |
Returns
Type | Description |
|---|---|
double | Upload progress. The value ranges from 0.0 (0%) to 1.0 (100%). |
Throws
Name | Description |
|---|---|
java.io.IOException | I/O exception thrown upon an API call failure. You can use the getMessage() method to obtain the error description. |