if (!blobStore.blobExists(bucketName, expectedFileName)) { blobStore.deleteContainer(bucketName); Assert.fail("Blob does not exist: " + expectedFileName);
if ( !blobStore.blobExists( bucketName, expectedFileName ) ) { assert ( false );
private static void handleAbortMultipartUpload(HttpServletResponse response, BlobStore blobStore, String containerName, String blobName, String uploadId) throws IOException, S3Exception { if (Quirks.MULTIPART_REQUIRES_STUB.contains(getBlobStoreType( blobStore))) { if (!blobStore.blobExists(containerName, uploadId)) { throw new S3Exception(S3ErrorCode.NO_SUCH_UPLOAD); } blobStore.removeBlob(containerName, uploadId); } // TODO: how to reconstruct original mpu? MultipartUpload mpu = MultipartUpload.create(containerName, blobName, uploadId, createFakeBlobMetadata(blobStore), new PutOptions()); blobStore.abortMultipartUpload(mpu); response.sendError(HttpServletResponse.SC_NO_CONTENT); }
@Override public boolean containsKey(Object key) { String realKey = prefixer.apply(checkNotNull(key, "key").toString()); return blobstore.blobExists(containerName, realKey); }
@Override public boolean containsKey(Object key) { String realKey = prefixer.apply(checkNotNull(key, "key").toString()); return blobstore.blobExists(containerName, realKey); }
private void checkExistsBlob(String name) throws IOException { if (container == null || !context.getBlobStore().blobExists(container, name)) { throw new IOException("Blob not found: " + container + ":" + name); } }
@Override public boolean objectClaimed(String key) throws IOException { if (!this.clustered) return true; String blb = "claims/" + key + "/" + EncyptUtils.encHashArchiveName(Main.DSEID, Main.chunkStoreEncryptionEnabled); return blobStore.blobExists(this.name, blb); }
private void checkExistsBlob(String name) throws IOException { if (container == null || !context.getBlobStore().blobExists(container, name)) { throw new IOException("Blob not found: " + container + ":" + name); } }
@Override public boolean isCheckedOut(String name, long volumeID) throws IOException { if (!this.clustered) return true; String blb = "claims/" + name + "/" + EncyptUtils.encHashArchiveName(volumeID, Main.chunkStoreEncryptionEnabled); return blobStore.blobExists(this.name, blb); }
@Override public boolean blobExists(String container, String name) { return delegate().blobExists(container, name); }
/** * Sign out member to the {@link DiscoveryService}. */ @Override public void signOut() { if (blobStore.blobExists(container, ipAddress)) { blobStore.removeBlob(container, ipAddress); } else { LOGGER.debug("CELLAR CLOUD: could not find the IP address of the current node in the blob store"); } }
@Override public boolean fileExists(long id) throws IOException { try { String haName = EncyptUtils.encHashArchiveName(id, Main.chunkStoreEncryptionEnabled); return blobStore.blobExists(this.name, "blocks/" + haName); } catch (Exception e) { SDFSLogger.getLog().error("unable to get id", e); throw new IOException(e); } }
@Override protected Object doExecute() throws Exception { BlobStore blobStore = getBlobStore(); if (!blobStore.blobExists(containerName, blobName)) { throw new KeyNotFoundException(containerName, blobName, "while checking existence"); } return null; } }
public void run() { try { assert !view.getBlobStore().blobExists(containerName, name) : String.format("found %s in %s", name, containerName); } catch (Exception e) { Throwables.propagateIfPossible(e); } } });
public void run() { try { assert view.getBlobStore().blobExists(containerName, name) : String.format( "could not find %s in %s: %s", name, containerName, ImmutableSet.copyOf(Iterables.transform( view.getBlobStore().list(containerName), new Function<StorageMetadata, String>() { public String apply(StorageMetadata from) { return from.getName(); } }))); } catch (Exception e) { Throwables.propagateIfPossible(e); } } });
@Test(dataProvider = "ignoreOnMacOSX") public void testGetDirectoryBlob() throws IOException { blobStore.createContainerInLocation(null, CONTAINER_NAME); String blobKey = TestUtils.createRandomBlobKey("a/b/c/directory-", "/"); blobStore.putBlob(CONTAINER_NAME, createDirBlob(blobKey)); assertTrue(blobStore.blobExists(CONTAINER_NAME, blobKey)); Blob blob = blobStore.getBlob(CONTAINER_NAME, blobKey); assertEquals(blob.getMetadata().getName(), blobKey, "Created blob name is different"); assertTrue(!blobStore.blobExists(CONTAINER_NAME, blobKey.substring(0, blobKey.length() - 1))); }
@Override public boolean isInStorage() { BlobStoreContext context = createContext(); try { BlobStore store = createBlobStore(context); return store.blobExists(getContainer(), getPath()); } finally { context.close(); } } }
@Test(groups = { "integration", "live" }) public void blobNotFound() throws InterruptedException { String container = getContainerName(); String name = "test"; try { assert !view.getBlobStore().blobExists(container, name); } finally { returnContainer(container); } }
@Test(groups = { "integration", "live" }) public void blobNotFound() throws InterruptedException { String container = getContainerName(); String name = "test"; try { assert !view.getBlobStore().blobExists(container, name); } finally { returnContainer(container); } }
@Override public void removeEntity( EntityReference ref, EntityDescriptor entityDescriptor ) throws EntityNotFoundException { if( !blobStore.blobExists( container, ref.identity().toString() ) ) { throw new EntityNotFoundException( ref ); } blobStore.removeBlob( container, ref.identity().toString() ); } }