Source:
<code>public MultipleFileUpload uploadFileList(String bucketName, String virtualDirectoryKeyPrefix, File directory, List<File> files, ObjectMetadataProvider metadataProvider, ObjectTaggingProvider taggingProvider) { if ( directory == null || !directory.exists() || !directory.isDirectory() ) { throw new IllegalArgumentException("Must provide a common base directory for uploaded files"); } if (virtualDirectoryKeyPrefix == null || virtualDirectoryKeyPrefix.length() == 0) { virtualDirectoryKeyPrefix = ""; } else if ( !virtualDirectoryKeyPrefix.endsWith("/") ) { virtualDirectoryKeyPrefix = virtualDirectoryKeyPrefix + "/"; } ProgressListenerChain additionalListeners = new ProgressListenerChain(); TransferProgress progress = new TransferProgress(); ProgressListener listener = new MultipleFileTransferProgressUpdatingListener( progress, additionalListeners); List<UploadImpl> uploads = new LinkedList<UploadImpl>(); MultipleFileUploadImpl multipleFileUpload = new MultipleFileUploadImpl("Uploading etc", progress, additionalListeners, virtualDirectoryKeyPrefix, bucketName, uploads); multipleFileUpload.setMonitor(new MultipleFileTransferMonitor(multipleFileUpload, uploads)); final CountDownLatch latch = new CountDownLatch(1); MultipleFileTransferStateChangeListener transferListener = new MultipleFileTransferStateChangeListener(latch, multipleFileUpload); if (files == null || files.isEmpty()) { multipleFileUpload.setState(Transfer.TransferState.Completed); } else { int startingPosition = directory.getAbsolutePath().length(); if (!(directory.getAbsolutePath().endsWith(File.separator))) startingPosition++; long totalSize = 0; for (File f : files) { if (f.isFile()) { totalSize += f.length(); String key = f.getAbsolutePath() .substring(startingPosition) .replaceAll("\\\\", "/"); ObjectMetadata metadata = new ObjectMetadata(); <START> ObjectTagging objectTagging = new ObjectTagging(new ArrayList<Tag>()); <END> if (metadataProvider != null) { metadataProvider.provideObjectMetadata(f, metadata); } if(taggingProvider != null) { objectTagging = taggingProvider.provideObjectTags(f); } uploads.add((UploadImpl) doUpload( new PutObjectRequest(bucketName, virtualDirectoryKeyPrefix + key, f) .withMetadata(metadata) .withTagging(objectTagging) .<PutObjectRequest> withGeneralProgressListener( listener), transferListener, null, null)); } } progress.setTotalBytesToTransfer(totalSize); } latch.countDown(); return multipleFileUpload; }</code><technical_language>Initialize null</technical_language>

Target:
public MultipleFileUpload uploadFileList(String bucketName, String virtualDirectoryKeyPrefix, File directory, List<File> files, ObjectMetadataProvider metadataProvider, ObjectTaggingProvider taggingProvider) { if ( directory == null || !directory.exists() || !directory.isDirectory() ) { throw new IllegalArgumentException("Must provide a common base directory for uploaded files"); } if (virtualDirectoryKeyPrefix == null || virtualDirectoryKeyPrefix.length() == 0) { virtualDirectoryKeyPrefix = ""; } else if ( !virtualDirectoryKeyPrefix.endsWith("/") ) { virtualDirectoryKeyPrefix = virtualDirectoryKeyPrefix + "/"; } ProgressListenerChain additionalListeners = new ProgressListenerChain(); TransferProgress progress = new TransferProgress(); ProgressListener listener = new MultipleFileTransferProgressUpdatingListener( progress, additionalListeners); List<UploadImpl> uploads = new LinkedList<UploadImpl>(); MultipleFileUploadImpl multipleFileUpload = new MultipleFileUploadImpl("Uploading etc", progress, additionalListeners, virtualDirectoryKeyPrefix, bucketName, uploads); multipleFileUpload.setMonitor(new MultipleFileTransferMonitor(multipleFileUpload, uploads)); final CountDownLatch latch = new CountDownLatch(1); MultipleFileTransferStateChangeListener transferListener = new MultipleFileTransferStateChangeListener(latch, multipleFileUpload); if (files == null || files.isEmpty()) { multipleFileUpload.setState(Transfer.TransferState.Completed); } else { int startingPosition = directory.getAbsolutePath().length(); if (!(directory.getAbsolutePath().endsWith(File.separator))) startingPosition++; long totalSize = 0; for (File f : files) { if (f.isFile()) { totalSize += f.length(); String key = f.getAbsolutePath() .substring(startingPosition) .replaceAll("\\\\", "/"); ObjectMetadata metadata = new ObjectMetadata(); ObjectTagging objectTagging = null; if (metadataProvider != null) { metadataProvider.provideObjectMetadata(f, metadata); } if(taggingProvider != null) { objectTagging = taggingProvider.provideObjectTags(f); } uploads.add((UploadImpl) doUpload( new PutObjectRequest(bucketName, virtualDirectoryKeyPrefix + key, f) .withMetadata(metadata) .withTagging(objectTagging) .<PutObjectRequest> withGeneralProgressListener( listener), transferListener, null, null)); } } progress.setTotalBytesToTransfer(totalSize); } latch.countDown(); return multipleFileUpload; }