public static class

ResumableHttpFileUploader.Builder

extends Object
java.lang.Object
   ↳ com.google.gdata.client.uploader.ResumableHttpFileUploader.Builder

Class Overview

Builder class for constructing ResumableHttpFileUploader instances.

Summary

Fields
private BackoffPolicy backoffPolicy
private long chunkSize
private UploadData data
private ExecutorService executor
private long progressIntervalMillis
private ProgressListener progressListener
private ResumableHttpFileUploader.RequestMethod requestMethod
private URL url
private UrlConnectionFactory urlConnectionFactory
Public Constructors
ResumableHttpFileUploader.Builder()
Public Methods
ResumableHttpFileUploader build()
Constructs a ResumableHttpFileUploader instance from this builder.
ResumableHttpFileUploader.Builder setBackoffPolicy(BackoffPolicy backoffPolicy)
ResumableHttpFileUploader.Builder setChunkSize(long chunkSize)
ResumableHttpFileUploader.Builder setData(UploadData data)
ResumableHttpFileUploader.Builder setExecutorService(ExecutorService executor)
ResumableHttpFileUploader.Builder setFile(File file)
ResumableHttpFileUploader.Builder setProgressIntervalMillis(long progressIntervalMillis)
ResumableHttpFileUploader.Builder setProgressListener(ProgressListener progressListener)
ResumableHttpFileUploader.Builder setRequestMethod(ResumableHttpFileUploader.RequestMethod requestMethod)
ResumableHttpFileUploader.Builder setUrl(URL url)
ResumableHttpFileUploader.Builder setUrlConnectionFactory(UrlConnectionFactory urlConnectionFactory)
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private BackoffPolicy backoffPolicy

private long chunkSize

private UploadData data

private ExecutorService executor

private long progressIntervalMillis

private ProgressListener progressListener

private URL url

private UrlConnectionFactory urlConnectionFactory

Public Constructors

public ResumableHttpFileUploader.Builder ()

Public Methods

public ResumableHttpFileUploader build ()

Constructs a ResumableHttpFileUploader instance from this builder.

Returns
  • a new ResumableHttpFileUploader according to the builder parameters
Throws
IOException

public ResumableHttpFileUploader.Builder setBackoffPolicy (BackoffPolicy backoffPolicy)

Parameters
backoffPolicy To determine how long to wait until retrying HTTP requests
Returns
  • this

public ResumableHttpFileUploader.Builder setChunkSize (long chunkSize)

Parameters
chunkSize Size of the chunks that will get uploaded by individual HTTP requests
Returns
  • this

public ResumableHttpFileUploader.Builder setData (UploadData data)

Parameters
data To be uploaded.
Returns
  • this

public ResumableHttpFileUploader.Builder setExecutorService (ExecutorService executor)

Parameters
executor Service to execute asynchronous upload tasks with
Returns
  • this

public ResumableHttpFileUploader.Builder setFile (File file)

Parameters
file To be uploaded.
Returns
  • this
Throws
IOException if the file could not be read.

public ResumableHttpFileUploader.Builder setProgressIntervalMillis (long progressIntervalMillis)

Parameters
progressIntervalMillis Number of milliseconds between progress listener notifications
Returns
  • this

public ResumableHttpFileUploader.Builder setProgressListener (ProgressListener progressListener)

Parameters
progressListener For receiving progress notifications
Returns
  • this

public ResumableHttpFileUploader.Builder setRequestMethod (ResumableHttpFileUploader.RequestMethod requestMethod)

Parameters
requestMethod The http request type for upload. Use either PUT request or POST request with x-http-method-override header set to PUT.
Returns
  • this

public ResumableHttpFileUploader.Builder setUrl (URL url)

Parameters
url Which locates the destination of the upload request
Returns
  • this

public ResumableHttpFileUploader.Builder setUrlConnectionFactory (UrlConnectionFactory urlConnectionFactory)

Parameters
urlConnectionFactory
Returns
  • this