org.jclouds.blobstore.BlobStore.getBlobAccess()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(111)

本文整理了Java中org.jclouds.blobstore.BlobStore.getBlobAccess()方法的一些代码示例,展示了BlobStore.getBlobAccess()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BlobStore.getBlobAccess()方法的具体详情如下:
包路径:org.jclouds.blobstore.BlobStore
类名称:BlobStore
方法名:getBlobAccess

BlobStore.getBlobAccess介绍

暂无

代码示例

代码示例来源:origin: gaul/s3proxy

private static boolean checkPublicAccess(BlobStore blobStore,
    String containerName, String blobName) {
  String blobStoreType = getBlobStoreType(blobStore);
  if (Quirks.NO_BLOB_ACCESS_CONTROL.contains(blobStoreType)) {
    ContainerAccess access = blobStore.getContainerAccess(
        containerName);
    return access == ContainerAccess.PUBLIC_READ;
  } else {
    BlobAccess access = blobStore.getBlobAccess(containerName,
        blobName);
    return access == BlobAccess.PUBLIC_READ;
  }
}

代码示例来源:origin: gaul/s3proxy

private void handleGetBlobAcl(HttpServletResponse response,
    BlobStore blobStore, String containerName,
    String blobName) throws IOException {
  BlobAccess access = blobStore.getBlobAccess(containerName, blobName);

代码示例来源:origin: gaul/s3proxy

blobStore))) {
Blob stubBlob = blobStore.getBlob(containerName, uploadId);
BlobAccess access = blobStore.getBlobAccess(containerName,
    uploadId);
mpu = MultipartUpload.create(containerName,

代码示例来源:origin: org.apache.jclouds/jclouds-blobstore

@Override
public BlobAccess getBlobAccess(String container, String name) {
 return delegate().getBlobAccess(container, name);
}

代码示例来源:origin: Nextdoor/bender

@Override
public BlobAccess getBlobAccess(String container, String name) {
 return delegate().getBlobAccess(container, name);
}

代码示例来源:origin: apache/jclouds

@Override
public BlobAccess getBlobAccess(String container, String name) {
 return delegate().getBlobAccess(container, name);
}

代码示例来源:origin: com.amysta.jclouds/jclouds-blobstore

@Override
public BlobAccess getBlobAccess(String container, String name) {
 return delegate().getBlobAccess(container, name);
}

代码示例来源:origin: org.gaul/s3proxy

private static boolean checkPublicAccess(BlobStore blobStore,
    String containerName, String blobName) {
  String blobStoreType = getBlobStoreType(blobStore);
  if (Quirks.NO_BLOB_ACCESS_CONTROL.contains(blobStoreType)) {
    ContainerAccess access = blobStore.getContainerAccess(
        containerName);
    return access == ContainerAccess.PUBLIC_READ;
  } else {
    BlobAccess access = blobStore.getBlobAccess(containerName,
        blobName);
    return access == BlobAccess.PUBLIC_READ;
  }
}

代码示例来源:origin: Nextdoor/bender

private static boolean checkPublicAccess(BlobStore blobStore,
    String containerName, String blobName) {
  String blobStoreType = getBlobStoreType(blobStore);
  if (Quirks.NO_BLOB_ACCESS_CONTROL.contains(blobStoreType)) {
    ContainerAccess access = blobStore.getContainerAccess(
        containerName);
    return access == ContainerAccess.PUBLIC_READ;
  } else {
    BlobAccess access = blobStore.getBlobAccess(containerName,
        blobName);
    return access == BlobAccess.PUBLIC_READ;
  }
}

代码示例来源:origin: org.gaul/s3proxy

private void handleGetBlobAcl(HttpServletResponse response,
    BlobStore blobStore, String containerName,
    String blobName) throws IOException {
  BlobAccess access = blobStore.getBlobAccess(containerName, blobName);

代码示例来源:origin: Nextdoor/bender

private void handleGetBlobAcl(HttpServletResponse response,
    BlobStore blobStore, String containerName,
    String blobName) throws IOException {
  BlobAccess access = blobStore.getBlobAccess(containerName, blobName);

代码示例来源:origin: org.gaul/s3proxy

blobStore))) {
Blob stubBlob = blobStore.getBlob(containerName, uploadId);
BlobAccess access = blobStore.getBlobAccess(containerName,
    uploadId);
mpu = MultipartUpload.create(containerName,

代码示例来源:origin: Nextdoor/bender

blobStore))) {
Blob stubBlob = blobStore.getBlob(containerName, uploadId);
BlobAccess access = blobStore.getBlobAccess(containerName,
    uploadId);
mpu = MultipartUpload.create(containerName,

代码示例来源:origin: apache/jclouds

@Test(groups = { "integration", "live" })
public void testSetBlobAccess() throws Exception {
 BlobStore blobStore = view.getBlobStore();
 String containerName = getContainerName();
 String blobName = "set-access-blob-name";
 try {
   addBlobToContainer(containerName, blobName, blobName, MediaType.TEXT_PLAIN);
   assertThat(blobStore.getBlobAccess(containerName, blobName)).isEqualTo(BlobAccess.PRIVATE);
   blobStore.setBlobAccess(containerName, blobName, BlobAccess.PUBLIC_READ);
   assertThat(blobStore.getBlobAccess(containerName, blobName)).isEqualTo(BlobAccess.PUBLIC_READ);
   // test that blob is anonymously readable
   HttpRequest request = view.getSigner().signGetBlob(containerName, blobName).toBuilder()
      .replaceQueryParams(ImmutableMap.<String, String>of()).build();
   HttpResponse response = view.utils().http().invoke(request);
   assertThat(response.getStatusCode()).isEqualTo(200);
   blobStore.setBlobAccess(containerName, blobName, BlobAccess.PRIVATE);
   assertThat(blobStore.getBlobAccess(containerName, blobName)).isEqualTo(BlobAccess.PRIVATE);
 } finally {
   returnContainer(containerName);
 }
}

代码示例来源:origin: apache/jclouds

@Test(groups = { "integration", "live" })
public void testPutBlobAccess() throws Exception {
 BlobStore blobStore = view.getBlobStore();
 String containerName = getContainerName();
 try {
   String blobNamePrivate = "put-access-blob-name-private";
   Blob blobPrivate = blobStore.blobBuilder(blobNamePrivate).payload(new byte[1]).build();
   blobStore.putBlob(containerName, blobPrivate, new PutOptions().setBlobAccess(BlobAccess.PRIVATE));
   assertThat(blobStore.getBlobAccess(containerName, blobNamePrivate)).isEqualTo(BlobAccess.PRIVATE);
   String blobNamePublic = "put-access-blob-name-public";
   Blob blobPublic = blobStore.blobBuilder(blobNamePublic).payload(new byte[1]).build();
   blobStore.putBlob(containerName, blobPublic, new PutOptions().setBlobAccess(BlobAccess.PUBLIC_READ));
   assertThat(blobStore.getBlobAccess(containerName, blobNamePublic)).isEqualTo(BlobAccess.PUBLIC_READ);
 } finally {
   returnContainer(containerName);
 }
}

代码示例来源:origin: apache/jclouds

@Test(groups = { "integration", "live" })
public void testPutBlobAccessMultipart() throws Exception {
 BlobStore blobStore = view.getBlobStore();
 String containerName = getContainerName();
 ByteSource byteSource = TestUtils.randomByteSource().slice(0, getMinimumMultipartBlobSize());
 Payload payload = Payloads.newByteSourcePayload(byteSource);
 payload.getContentMetadata().setContentLength(byteSource.size());
 try {
   String blobNamePrivate = "put-access-blob-name-private";
   Blob blobPrivate = blobStore.blobBuilder(blobNamePrivate).payload(payload).build();
   blobStore.putBlob(containerName, blobPrivate, new PutOptions().setBlobAccess(BlobAccess.PRIVATE).multipart(true));
   assertThat(blobStore.getBlobAccess(containerName, blobNamePrivate)).isEqualTo(BlobAccess.PRIVATE);
   String blobNamePublic = "put-access-blob-name-public";
   Blob blobPublic = blobStore.blobBuilder(blobNamePublic).payload(payload).build();
   blobStore.putBlob(containerName, blobPublic, new PutOptions().setBlobAccess(BlobAccess.PUBLIC_READ).multipart(true));
   assertThat(blobStore.getBlobAccess(containerName, blobNamePublic)).isEqualTo(BlobAccess.PUBLIC_READ);
 } finally {
   returnContainer(containerName);
 }
}

相关文章