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


Java BlobMetadata.getCreationDate方法代码示例

本文整理汇总了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;
    }
 
开发者ID:NLeSC,项目名称:Xenon,代码行数:22,代码来源:JCloudsFileSytem.java

示例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;
	}
}
 
开发者ID:brdara,项目名称:java-cloud-filesystem-provider,代码行数:30,代码来源:CloudBasicFileAttributes.java


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