当前位置: 首页>>代码示例>>Java>>正文


Java MultipartUtils.uploadObjects方法代码示例

本文整理汇总了Java中org.jets3t.service.utils.MultipartUtils.uploadObjects方法的典型用法代码示例。如果您正苦于以下问题:Java MultipartUtils.uploadObjects方法的具体用法?Java MultipartUtils.uploadObjects怎么用?Java MultipartUtils.uploadObjects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jets3t.service.utils.MultipartUtils的用法示例。


在下文中一共展示了MultipartUtils.uploadObjects方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: storeLargeFile

import org.jets3t.service.utils.MultipartUtils; //导入方法依赖的package包/类
public void storeLargeFile(String key, File file, byte[] md5Hash)
    throws IOException {
  S3Object object = new S3Object(key);
  object.setDataInputFile(file);
  object.setContentType("binary/octet-stream");
  object.setContentLength(file.length());
  object.setServerSideEncryptionAlgorithm(serverSideEncryptionAlgorithm);
  if (md5Hash != null) {
    object.setMd5Hash(md5Hash);
  }

  List<StorageObject> objectsToUploadAsMultipart =
      new ArrayList<StorageObject>();
  objectsToUploadAsMultipart.add(object);
  MultipartUtils mpUtils = new MultipartUtils(multipartBlockSize);

  try {
    mpUtils.uploadObjects(bucket.getName(), s3Service,
                          objectsToUploadAsMultipart, null);
  } catch (Exception e) {
    handleException(e, key);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:Jets3tNativeFileSystemStore.java

示例2: uploadObjectsAsMultiparts

import org.jets3t.service.utils.MultipartUtils; //导入方法依赖的package包/类
@Override
public void uploadObjectsAsMultiparts(final String bucketName, final List<StorageObject> objects)
		throws ServiceException, Exception {
	LOGGER.info("putObjectsAsMultiparts invoked, bucketName: {}", bucketName);
	final MultipartUtils multipartUtils = new MultipartUtils();
       multipartUtils.uploadObjects(bucketName, s3Service, objects, null);	
}
 
开发者ID:abhinavmishra14,项目名称:aws-s3-utils,代码行数:8,代码来源:JetS3RESTServiceImpl.java

示例3: uploadDirectoryAsMultiparts

import org.jets3t.service.utils.MultipartUtils; //导入方法依赖的package包/类
@Override
public void uploadDirectoryAsMultiparts(final String bucketName, final File dirPath)
		throws ServiceException, Exception {
	LOGGER.info("uploadDirectoryAsMultiparts invoked, bucketName: {} and dirPath: {}", bucketName, dirPath);
	final Set<File> setOfFilePath = DirectoryTraverser.getFileUris(dirPath);
	final List<StorageObject> objects = new ArrayList<StorageObject>();
	for (final File file : setOfFilePath) {
		objects.add(ObjectUtils.createObjectForUpload(file.getName(), file, null, // encryptionUtil
				false // gzipFile
		));
	}
	
	final MultipartUtils multipartUtils = new MultipartUtils();
	multipartUtils.uploadObjects(bucketName, s3Service, objects, null);
}
 
开发者ID:abhinavmishra14,项目名称:aws-s3-utils,代码行数:16,代码来源:JetS3RESTServiceImpl.java

示例4: multipartUpload

import org.jets3t.service.utils.MultipartUtils; //导入方法依赖的package包/类
private void multipartUpload(S3Object object) throws Exception {

    List<StorageObject> objectsToUploadAsMultipart = Arrays.<StorageObject>asList(object);

    MultipartUtils mpUtils = new MultipartUtils(configuration.getUploadPartSize());
    mpUtils.uploadObjects(s3Bucket.getName(), s3Service, objectsToUploadAsMultipart, null);
  }
 
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:8,代码来源:SingularityS3Uploader.java


注:本文中的org.jets3t.service.utils.MultipartUtils.uploadObjects方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。