Source:
private void performUploads(Map<String, String> metadata, final String bucketName, final String objectPrefix, final GoogleRobotCredentials credentials, final UploadSpec uploads, final TaskListener listener) throws UploadException { RepeatAction<UploadException> a = new RepeatAction<UploadException>() { private Queue<FilePath> paths; Storage service; Executor executor; Bucket bucket; { paths = new LinkedList<>(uploads.inclusions); executor = module.newExecutor(); } @Override public void initCredentials() throws UploadException { service = module.getStorageService(credentials); bucket = getOrCreateBucket(service, credentials, executor, bucketName); } @Override public void act() throws HttpResponseException, UploadException, IOException, InterruptedException, ExecutorException { FilePath include = paths.peek(); String relativePath = StorageUtil .getRelative(include, uploads.workspace); String uploadedFileName = StorageUtil .getStrippedFilename(relativePath, pathPrefix); String finalName = FilenameUtils.separatorsToUnix( FilenameUtils.concat(objectPrefix, uploadedFileName)); StorageObject object = new StorageObject() .setName(finalName) .setContentDisposition( HttpHeaders.getContentDisposition( include.getName(), isShowInline())) .setContentType( detectMIMEType(include.getName())) .setSize(BigInteger.valueOf(include.length())); if (isSharedPublicly()) { object.setAcl(addPublicReadAccess( getDefaultObjectAcl(bucket, listener))); } annotateObject(object, listener); listener.getLogger().println(module.prefix( Messages.AbstractUpload_Uploading(relativePath))); performUploadWithRetry(executor, service, bucket, object, include); paths.remove(); } @Override public boolean moreWork() { return !paths.isEmpty(); } }; try { RetryStorageOperation.performRequestWithReinitCredentials(a, MAX_REMOTE_CREDENTIAL_EXPIRED_RETRIES); } catch (ForbiddenException e) { throw new UploadException( Messages.AbstractUpload_ForbiddenFileUpload(), e); } catch (ExecutorException e) { throw new UploadException( Messages.AbstractUpload_ExceptionFileUpload(), e); } catch (IOException e) { throw new UploadException( Messages.AbstractUpload_ExceptionFileUpload(), e); } catch (InterruptedException e) { throw new UploadException( Messages.AbstractUpload_ExceptionFileUpload(), e); } }

Target:
private void performUploads(Map<String, String> metadata, final String bucketName, final String objectPrefix, final GoogleRobotCredentials credentials, final UploadSpec uploads, final TaskListener listener) throws UploadException { RepeatOperation<UploadException> a = new RepeatOperation<UploadException>() { private Queue<FilePath> paths = new LinkedList<>(uploads.inclusions);; Executor executor = module.newExecutor();; Storage service; Bucket bucket; @Override public void initCredentials() throws UploadException { service = module.getStorageService(credentials); bucket = getOrCreateBucket(service, credentials, executor, bucketName); } @Override public void act() throws HttpResponseException, UploadException, IOException, InterruptedException, ExecutorException { FilePath include = paths.peek(); String relativePath = StorageUtil .getRelative(include, uploads.workspace); String uploadedFileName = StorageUtil .getStrippedFilename(relativePath, pathPrefix); String finalName = FilenameUtils.separatorsToUnix( FilenameUtils.concat(objectPrefix, uploadedFileName)); StorageObject object = new StorageObject() .setName(finalName) .setContentDisposition( HttpHeaders.getContentDisposition( include.getName(), isShowInline())) .setContentType( detectMIMEType(include.getName())) .setSize(BigInteger.valueOf(include.length())); if (isSharedPublicly()) { object.setAcl(addPublicReadAccess( getDefaultObjectAcl(bucket, listener))); } annotateObject(object, listener); listener.getLogger().println(module.prefix( Messages.AbstractUpload_Uploading(relativePath))); performUploadWithRetry(executor, service, bucket, object, include); paths.remove(); } @Override public boolean moreWork() { return !paths.isEmpty(); } }; try { RetryStorageOperation.performRequestWithReinitCredentials(a, MAX_REMOTE_CREDENTIAL_EXPIRED_RETRIES); } catch (ForbiddenException e) { throw new UploadException( Messages.AbstractUpload_ForbiddenFileUpload(), e); } catch (ExecutorException e) { throw new UploadException( Messages.AbstractUpload_ExceptionFileUpload(), e); } catch (IOException e) { throw new UploadException( Messages.AbstractUpload_ExceptionFileUpload(), e); } catch (InterruptedException e) { throw new UploadException( Messages.AbstractUpload_ExceptionFileUpload(), e); } }