/**
  * Transport the file to Amazon Glacier and return the archive ID.
  *
  * @param \Transit\File $file
  * @return string
  * @throws \Transit\Exception\TransportationException
  */
 public function transport(File $file)
 {
     $config = $this->_config;
     $response = null;
     // If larger then 100MB, split upload into parts
     if ($file->size() >= 100 * Size::MB) {
         $uploader = UploadBuilder::newInstance()->setClient($this->getClient())->setSource($file->path())->setVaultName($config['vault'])->setAccountId($config['accountId'] ?: '-')->setPartSize(10 * Size::MB)->build();
         try {
             $response = $uploader->upload();
         } catch (MultipartUploadException $e) {
             $uploader->abort();
         }
     } else {
         $response = $this->getClient()->uploadArchive(array_filter(array('vaultName' => $config['vault'], 'accountId' => $config['accountId'], 'body' => EntityBody::factory(fopen($file->path(), 'r')))));
     }
     // Return archive ID if successful
     if ($response) {
         $file->delete();
         return $response->getPath('archiveId');
     }
     throw new TransportationException(sprintf('Failed to transport %s to Amazon Glacier', $file->basename()));
 }
 /**
  * Transport the file to a remote location.
  *
  * @param \Transit\File $file
  * @return string
  * @throws \Transit\Exception\TransportationException
  */
 public function transport(File $file)
 {
     $config = $this->_config;
     $key = ltrim($config['folder'], '/') . $file->basename();
     $response = null;
     // If larger then 100MB, split upload into parts
     if ($file->size() >= 100 * Size::MB) {
         $uploader = UploadBuilder::newInstance()->setClient($this->getClient())->setSource($file->path())->setBucket($config['bucket'])->setKey($key)->setMinPartSize(10 * Size::MB)->build();
         try {
             $response = $uploader->upload();
         } catch (MultipartUploadException $e) {
             $uploader->abort();
         }
     } else {
         $response = $this->getClient()->putObject(array_filter(array('Key' => $key, 'Bucket' => $config['bucket'], 'Body' => EntityBody::factory(fopen($file->path(), 'r')), 'ACL' => $config['acl'], 'ContentType' => $file->type(), 'ServerSideEncryption' => $config['encryption'], 'StorageClass' => $config['storage'], 'Metadata' => $config['meta'])));
     }
     // Return S3 URL if successful
     if ($response) {
         $file->delete();
         return sprintf('%s/%s/%s', S3Client::getEndpoint($this->getClient()->getDescription(), $config['region'], $config['scheme']), $config['bucket'], $key);
     }
     throw new TransportationException(sprintf('Failed to transport %s to Amazon S3', $file->basename()));
 }