public void delete(final URI uri) throws IOException { // check if blob was stored for the message, silently skip otherwise if (uri == null) { return; } boolean isDbProfile = new BlobURI().fromURI(uri).getProfile().equals(DatabaseConstants.DATABASE_PROFILE); if (isDbProfile) { dbBlobStorage.delete(uri); } else { cloudBlobStorage.delete(uri); } }