本文整理汇总了Java中org.jclouds.blobstore.domain.BlobMetadata.getCreationDate方法的典型用法代码示例。如果您正苦于以下问题:Java BlobMetadata.getCreationDate方法的具体用法?Java BlobMetadata.getCreationDate怎么用?Java BlobMetadata.getCreationDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jclouds.blobstore.domain.BlobMetadata
的用法示例。
在下文中一共展示了BlobMetadata.getCreationDate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeBlobAttributes
import org.jclouds.blobstore.domain.BlobMetadata; //导入方法依赖的package包/类
private PathAttributes makeBlobAttributes(String name) {
BlobMetadata md = context.getBlobStore().blobMetadata(bucket, name);
PathAttributesImplementation pa = new PathAttributesImplementation();
// Jclouds alway returns a name relative to the bucket, so we make it absolute first.
pa.setPath(new Path("/" + name));
pa.setLastAccessTime(md.getLastModified().getTime());
pa.setSize(md.getSize());
pa.setRegular(true);
if (md.getCreationDate() == null) {
pa.setCreationTime(pa.getLastModifiedTime());
} else {
pa.setCreationTime(md.getCreationDate().getTime());
}
pa.setLastAccessTime(md.getLastModified().getTime());
pa.setDirectory(false);
pa.setReadable(true);
return pa;
}
示例2: CloudBasicFileAttributes
import org.jclouds.blobstore.domain.BlobMetadata; //导入方法依赖的package包/类
public CloudBasicFileAttributes(BlobMetadata blobMetadata) {
lastModified = FileTime.from(Optional.ofNullable(blobMetadata.getLastModified().getTime()).orElse(0L), TimeUnit.MILLISECONDS);
created = blobMetadata.getCreationDate() == null ? lastModified : FileTime.from(blobMetadata.getCreationDate().getTime(), TimeUnit.MILLISECONDS);
key = blobMetadata.getProviderId();
storageType = blobMetadata.getType();
physicalLocation = blobMetadata.getLocation();
uri = blobMetadata.getUri();
size = Optional.ofNullable(blobMetadata.getSize()).orElse(Long.valueOf(0));
eTag = blobMetadata.getETag();
userMetadata = blobMetadata.getUserMetadata();
if (isRegularFile()) {
ContentMetadata contentMetadata = blobMetadata.getContentMetadata();
contentDisposition = contentMetadata.getContentDisposition();
contentEncoding = contentMetadata.getContentEncoding();
contentLanguage = contentMetadata.getContentLanguage();
contentMD5 = contentMetadata.getContentMD5AsHashCode();
contentType = contentMetadata.getContentType();
expires = contentMetadata.getExpires() == null ? null :
FileTime.from(contentMetadata.getExpires().getTime(), TimeUnit.MILLISECONDS);
} else {
contentDisposition = null;
contentEncoding = null;
contentLanguage = null;
contentMD5 = null;
contentType = null;
expires = null;
}
}