Google Data APIs Client Library (1.41.1)



com.google.gdata.client.media
Class ResumableGDataFileUploader.Builder

java.lang.Object
  extended by com.google.gdata.client.media.ResumableGDataFileUploader.Builder
Enclosing class:
ResumableGDataFileUploader

public static class ResumableGDataFileUploader.Builder
extends java.lang.Object

Builder to construct a ResumableGDataFileUploader.


Constructor Summary
ResumableGDataFileUploader.Builder(MediaService service, MediaFileSource mediaFile, IEntry entryToUpdate)
          Builds a ResumableGDataFileUploader to update an existing media.
ResumableGDataFileUploader.Builder(MediaService service, java.net.URL mediaUrl, MediaFileSource mediaFile, IEntry mediaEntry)
          Builds a ResumableGDataFileUploader to upload new media.
 
Method Summary
 ResumableGDataFileUploader build()
          Creates a ResumableGDataFileUploader instance.
 ResumableGDataFileUploader.Builder chunkSize(long chunkSize)
          Max content size for media upload request.
 ResumableGDataFileUploader.Builder executor(java.util.concurrent.ExecutorService executor)
          Sets ExecutorService to execute asynchronous tasks.
 ResumableGDataFileUploader.Builder requestType(ResumableGDataFileUploader.RequestType requestType)
          Sets the media upload request type.
 ResumableGDataFileUploader.Builder title(java.lang.String mediaTitle)
          Sets title for uploaded media.
 ResumableGDataFileUploader.Builder trackProgress(ProgressListener listener, long progressInterval)
          Sets parameters to track upload progress.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResumableGDataFileUploader.Builder

public ResumableGDataFileUploader.Builder(MediaService service,
                                          java.net.URL mediaUrl,
                                          MediaFileSource mediaFile,
                                          IEntry mediaEntry)
Builds a ResumableGDataFileUploader to upload new media.

Parameters:
service - media service
mediaUrl - resumable-create-media url.
mediaFile - file to upload.
mediaEntry - metadata for the uploaded file.

ResumableGDataFileUploader.Builder

public ResumableGDataFileUploader.Builder(MediaService service,
                                          MediaFileSource mediaFile,
                                          IEntry entryToUpdate)
Builds a ResumableGDataFileUploader to update an existing media.

Parameters:
service - media service.
mediaFile - updated file to upload.
entryToUpdate - updated metadata associated with the existing entry.
Method Detail

title

public ResumableGDataFileUploader.Builder title(java.lang.String mediaTitle)
Sets title for uploaded media. This value passed as Slug header in media requests.

Parameters:
mediaTitle - title for new media.
Returns:
builder.

chunkSize

public ResumableGDataFileUploader.Builder chunkSize(long chunkSize)
Max content size for media upload request.

Parameters:
chunkSize - max upload size in bytes.
Returns:
builder.

executor

public ResumableGDataFileUploader.Builder executor(java.util.concurrent.ExecutorService executor)
Sets ExecutorService to execute asynchronous tasks.

Parameters:
executor - executor service to use.
Returns:
builder.

trackProgress

public ResumableGDataFileUploader.Builder trackProgress(ProgressListener listener,
                                                        long progressInterval)
Sets parameters to track upload progress.

Parameters:
listener - ProgressListener callback for tracking progress.
progressInterval - time interval in millis for progress notifications.
Returns:
builder.

requestType

public ResumableGDataFileUploader.Builder requestType(ResumableGDataFileUploader.RequestType requestType)
Sets the media upload request type.

Parameters:
requestType - one of INSERT, UPDATE, UPDATE_MEDIA_ONLY
Returns:
builder.

build

public ResumableGDataFileUploader build()
                                 throws java.io.IOException,
                                        ServiceException
Creates a ResumableGDataFileUploader instance.

Returns:
uploader.
Throws:
java.io.IOException - any read/write error.
ServiceException - any server error.