Search in sources :

Example 6 with CObjectMetadata

use of com.mendmix.cos.CObjectMetadata in project jeesuite-libs by vakinge.

the class QiniuProvider method getObjectMetadata.

@Override
public CObjectMetadata getObjectMetadata(String bucketName, String fileKey) {
    try {
        bucketName = buildBucketName(bucketName);
        FileInfo stat = bucketManager.stat(bucketName, fileKey);
        CObjectMetadata objectMetadata = new CObjectMetadata();
        objectMetadata.setCreateTime(new Date(stat.putTime));
        objectMetadata.setFilesize(stat.fsize);
        objectMetadata.setHash(stat.md5);
        objectMetadata.setMimeType(stat.mimeType);
        return objectMetadata;
    } catch (QiniuException e) {
        processQiniuException(bucketName, e);
        return null;
    }
}
Also used : CObjectMetadata(com.mendmix.cos.CObjectMetadata) QiniuException(com.qiniu.common.QiniuException) FileInfo(com.qiniu.storage.model.FileInfo) Date(java.util.Date)

Aggregations

CObjectMetadata (com.mendmix.cos.CObjectMetadata)6 JeesuiteBaseException (com.mendmix.common.JeesuiteBaseException)3 IOException (java.io.IOException)2 OSSException (com.aliyun.oss.OSSException)1 ObjectMetadata (com.aliyun.oss.model.ObjectMetadata)1 CUploadObject (com.mendmix.cos.CUploadObject)1 ObjectMetadata (com.obs.services.model.ObjectMetadata)1 ObsObject (com.obs.services.model.ObsObject)1 CosServiceException (com.qcloud.cos.exception.CosServiceException)1 ObjectMetadata (com.qcloud.cos.model.ObjectMetadata)1 QiniuException (com.qiniu.common.QiniuException)1 FileInfo (com.qiniu.storage.model.FileInfo)1 StatObjectResponse (io.minio.StatObjectResponse)1 Date (java.util.Date)1 Map (java.util.Map)1 GetObjectRequest (software.amazon.awssdk.services.s3.model.GetObjectRequest)1 GetObjectResponse (software.amazon.awssdk.services.s3.model.GetObjectResponse)1 PresignedGetObjectRequest (software.amazon.awssdk.services.s3.presigner.model.PresignedGetObjectRequest)1