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


Java GetOptions.NONE属性代码示例

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


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

示例1: getBlob

/**
 * Applies the {@link GetOptionFileAttribute} if they exist to the {@link BlobStore#getBlob(String, String, GetOptions)} method.
 */
@Override
public Blob getBlob(BlobStoreContext blobStoreContext, CloudPath path, GetOptionFileAttribute getOption) {
	GetOptions getOptions = getOption == null ? GetOptions.NONE : getOption.value();
	return blobStoreContext.getBlobStore().getBlob(path.getContainerName(), path.getPathName(), getOptions);
}
 
开发者ID:brdara,项目名称:java-cloud-filesystem-provider,代码行数:8,代码来源:DefaultCloudFileChannelTransport.java

示例2: testGetFileAttributeOfType

@Test
public void testGetFileAttributeOfType() {
	CloudPermissionFileAttribute<AccessControlList> permAcl =
			new CloudPermissionFileAttribute<AccessControlList>(new AccessControlList());
	CloudPermissionFileAttribute<PosixFilePermission> permPosix =
			new CloudPermissionFileAttribute<PosixFilePermission>(PosixFilePermission.GROUP_WRITE);
	ContentTypeFileAttribute contentTypeGif = new ContentTypeFileAttribute(MediaType.GIF);
	GetOptionFileAttribute getOption = new GetOptionFileAttribute(GetOptions.NONE);
	PutOptionFileAttribute putOption = new PutOptionFileAttribute(PutOptions.NONE);
	FileAttributeLookupMap lookupMap = new FileAttributeLookupMap(
			permAcl,
			permPosix,
			contentTypeGif,
			getOption,
			putOption);

	// Test getting them explicitly by type
	Assert.assertEquals(lookupMap.toString(),
			permAcl, lookupMap.getFileAttributeOfType(CloudPermissionFileAttribute.class, AccessControlList.class));
	Assert.assertEquals(lookupMap.toString(),
			permPosix, lookupMap.getFileAttributeOfType(CloudPermissionFileAttribute.class, PosixFilePermission.class));
	Assert.assertEquals(lookupMap.toString(),
			contentTypeGif, lookupMap.getFileAttributeOfType(ContentTypeFileAttribute.class, MediaType.class));
	Assert.assertEquals(lookupMap.toString(),
			getOption, lookupMap.getFileAttributeOfType(GetOptionFileAttribute.class, GetOptions.class));
	Assert.assertEquals(lookupMap.toString(),
			putOption, lookupMap.getFileAttributeOfType(PutOptionFileAttribute.class, ImmutablePutOptions.class));
	
	// Test getting all of the attributes of a type
	Collection<CloudPermissionFileAttribute> permAttributes =
			lookupMap.getFileAttributesOfType(CloudPermissionFileAttribute.class);
	Assert.assertEquals(2, permAttributes.size());
	Assert.assertTrue(permAttributes.contains(permAcl));
	Assert.assertTrue(permAttributes.contains(permPosix));
	
	Collection<ContentTypeFileAttribute> contentTypeAttributes =
			lookupMap.getFileAttributesOfType(ContentTypeFileAttribute.class);
	Assert.assertEquals(1, contentTypeAttributes.size());
	Assert.assertEquals(contentTypeGif, contentTypeAttributes.iterator().next());

	Collection<GetOptionFileAttribute> getOptionAttributes =
			lookupMap.getFileAttributesOfType(GetOptionFileAttribute.class);
	Assert.assertEquals(1, getOptionAttributes.size());
	Assert.assertEquals(getOption, getOptionAttributes.iterator().next());

	Collection<PutOptionFileAttribute> putOptionAttributes =
			lookupMap.getFileAttributesOfType(PutOptionFileAttribute.class);
	Assert.assertEquals(1, putOptionAttributes.size());
	Assert.assertEquals(putOption, putOptionAttributes.iterator().next());
}
 
开发者ID:brdara,项目名称:java-cloud-filesystem-provider,代码行数:50,代码来源:FileAttributeLookupMapTest.java

示例3: BlobStoreByteSource

public BlobStoreByteSource(BlobStore blobStore, Blob blob, long size) throws IOException {
    this(blobStore, blob, GetOptions.NONE, size);
}
 
开发者ID:bouncestorage,项目名称:bouncestorage,代码行数:3,代码来源:BlobStoreByteSource.java


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