private UploadResult uploadInSinglePart(final String accountId,
            final String vaultName, final String archiveDescription,
            final File file, ProgressListener progressListener) {
        String checksum = TreeHashGenerator.calculateTreeHash(file);
        ResettableInputStream is = newResettableInputStream(file);
        try {
            publishProgress(progressListener, ProgressEventType.TRANSFER_STARTED_EVENT);
            final UploadArchiveRequest req = new UploadArchiveRequest()
                .withAccountId(accountId)
                .withArchiveDescription(archiveDescription)
                .withVaultName(vaultName)
                .withChecksum(checksum)
                .withBody(is)
                .withContentLength(file.length())
                // capture the bytes transferred
                .withGeneralProgressListener(progressListener)
                ;
            UploadArchiveResult uploadArchiveResult = glacier.uploadArchive(req);
            String artifactId = uploadArchiveResult.getArchiveId();
            publishProgress(progressListener, ProgressEventType.TRANSFER_COMPLETED_EVENT);
            return new UploadResult(artifactId);
        } catch (Throwable t) {
            publishProgress(progressListener, ProgressEventType.TRANSFER_FAILED_EVENT);
            throw failure(t);
        } finally {
            is.release();
        }
    }
Calculates the part size to use when uploading an archive of the
specified size using Glacier's multipart upload APIs. Because of the tree
hashing algorithm, part sizes must be aligned on 2^n MB boundaries (ex:
1MB, 2MB, 4MB, 8MB, etc). All parts must be the same size, except for the
last part.

@param fileSize
           The size of the file being uploaded.

@return The part size to use in the multipart upload.
aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/transfer/ArchiveTransferManager.java