ExecutorService executor =
Executors.newFixedThreadPool(MAX_CONCURRENT_UPLOADS);
// Create {@link ResumableGDataFileUploader} for each file to upload
List<ResumableGDataFileUploader> uploaders = Lists.newArrayList();
for (String fileName : files) {
MediaFileSource mediaFile = getMediaFileSource(fileName);
ResumableGDataFileUploader uploader =
new ResumableGDataFileUploader.Builder(
docs.service, new URL(url), mediaFile, null /*empty meatadata*/)
.title(mediaFile.getName())
.chunkSize(chunkSize).executor(executor)
.trackProgress(listener, PROGRESS_UPDATE_INTERVAL)
.build();
uploaders.add(uploader);
}