Google Data APIs Client Library (1.41.1)
com.google.gdata.client.uploader
Class ResumableHttpFileUploader.Builder
java.lang.Object
com.google.gdata.client.uploader.ResumableHttpFileUploader.Builder
- Enclosing class:
- ResumableHttpFileUploader
public static class ResumableHttpFileUploader.Builder
- extends java.lang.Object
Builder class for constructing ResumableHttpFileUploader
instances.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResumableHttpFileUploader.Builder
public ResumableHttpFileUploader.Builder()
setUrl
public ResumableHttpFileUploader.Builder setUrl(java.net.URL url)
- Parameters:
url
- which locates the destination of the upload request
- Returns:
- this
setFile
public ResumableHttpFileUploader.Builder setFile(java.io.File file)
throws java.io.IOException
- Parameters:
file
- to be uploaded.
- Returns:
- this
- Throws:
java.io.IOException
- if the file could not be read.
setData
public ResumableHttpFileUploader.Builder setData(UploadData data)
- Parameters:
data
- to be uploaded.
- Returns:
- this
setExecutorService
public ResumableHttpFileUploader.Builder setExecutorService(java.util.concurrent.ExecutorService executor)
- Parameters:
executor
- service to execute asynchronous upload tasks with
- Returns:
- this
setUrlConnectionFactory
public ResumableHttpFileUploader.Builder setUrlConnectionFactory(com.google.gdata.client.uploader.UrlConnectionFactory urlConnectionFactory)
- Parameters:
urlConnectionFactory
-
- Returns:
- this
setProgressListener
public ResumableHttpFileUploader.Builder setProgressListener(ProgressListener progressListener)
- Parameters:
progressListener
- for receiving progress notifications
- Returns:
- this
setChunkSize
public ResumableHttpFileUploader.Builder setChunkSize(long chunkSize)
- Parameters:
chunkSize
- size of the chunks that will get uploaded by individual
HTTP requests
- Returns:
- this
setProgressIntervalMillis
public ResumableHttpFileUploader.Builder setProgressIntervalMillis(long progressIntervalMillis)
- Parameters:
progressIntervalMillis
- number of milliseconds between
progress listener notifications
- Returns:
- this
setRequestMethod
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
setBackoffPolicy
public ResumableHttpFileUploader.Builder setBackoffPolicy(BackoffPolicy backoffPolicy)
- Parameters:
backoffPolicy
- to determine how long to wait until retrying HTTP
requests
- Returns:
- this
build
public ResumableHttpFileUploader build()
throws java.io.IOException
- Constructs a ResumableHttpFileUploader instance from this builder.
- Returns:
- a new ResumableHttpFileUploader according to the builder
parameters
- Throws:
java.io.IOException