public InputStream getBlobInputStream(final String containerName, final String blobPath) throws URISyntaxException, StorageException { CloudBlobContainer container = getCloudBlobContainer(containerName); return container.getBlockBlobReference(blobPath).openInputStream(); }
@Override public InputStream getStream(UUID jobId, String key) { try { CloudBlobContainer reference = blobClient.getContainerReference(BLOB_CONTAINER); CloudBlockBlob blob = reference.getBlockBlobReference(createRowKey(jobId, key)); return blob.openInputStream(); } catch (StorageException | URISyntaxException e) { throw new MicrosoftStorageException("Error returning stream for job: " + jobId, e); } }
@Override public InputStream getInputStream() throws IOException { try { assertExisted(); return this.blockBlob.openInputStream(); } catch (StorageException e) { log.error(MSG_FAIL_OPEN_INPUT, e); throw new IOException(MSG_FAIL_OPEN_INPUT); } }
public InputStream getBlobInputStream(final String containerName, final String blobPath) throws URISyntaxException, StorageException { CloudBlobContainer container = getCloudBlobContainer(containerName); return container.getBlockBlobReference(blobPath).openInputStream(); }
@Override protected InputStream doGetInputStream(String fullPath) { try { CloudBlockBlob blob = blobContainer.getBlockBlobReference(fullPath); return blob.openInputStream(); } catch (Exception exception) { throw E.unexpected(exception); } } }
@Override public InputStream read(DataIdentifier identifier) throws DataStoreException { if (null == identifier) throw new NullPointerException("identifier"); String key = getKeyName(identifier); long start = System.currentTimeMillis(); ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader( getClass().getClassLoader()); CloudBlockBlob blob = getAzureContainer().getBlockBlobReference(key); if (!blob.exists()) { throw new DataStoreException(String.format("Trying to read missing blob. identifier=%s", key)); } InputStream is = blob.openInputStream(); LOG.debug("Got input stream for blob. identifier={} duration={}", key, (System.currentTimeMillis() - start)); return is; } catch (StorageException e) { LOG.info("Error reading blob. identifier=%s", key); throw new DataStoreException(String.format("Cannot read blob. identifier=%s", key), e); } catch (URISyntaxException e) { LOG.debug("Error reading blob. identifier=%s", key); throw new DataStoreException(String.format("Cannot read blob. identifier=%s", key), e); } finally { if (contextClassLoader != null) { Thread.currentThread().setContextClassLoader(contextClassLoader); } } }
@Override public InputStream getStream() throws DataStoreException { String id = getKeyName(getIdentifier()); CloudBlobContainer container = Utils.getBlobContainer(connectionString, containerName); if (isMeta) { id = addMetaKeyPrefix(getIdentifier().toString()); } if (LOG.isDebugEnabled()) { // Log message, with exception so we can get a trace to see where the call // came from LOG.debug("binary downloaded from Azure Blob Storage: " + getIdentifier(), new Exception()); } try { return container.getBlockBlobReference(id).openInputStream(); } catch (StorageException | URISyntaxException e) { throw new DataStoreException(e); } }
this.reader = new LogRecordStreamReader(nextBlob.openInputStream()); return this.hasNext();
this.reader = new LogRecordStreamReader(nextBlob.openInputStream()); return this.hasNext();
blobRef.uploadFullBlob(sourceStream, blobLength, null, options, operationContext); BlobInputStream blobStream = blobRef.openInputStream();
BlobInputStream input = blockBlob.openInputStream(null, null, context);