Tabnine Logo
BlockBlobURL
Code IndexAdd Tabnine to your IDE (free)

How to use
BlockBlobURL
in
com.microsoft.azure.storage.blob

Best Java code snippets using com.microsoft.azure.storage.blob.BlockBlobURL (Showing top 20 results out of 315)

origin: com.microsoft.azure/azure-storage-blob

/**
 * Writes a blob by specifying the list of block IDs that are to make up the blob.
 * In order to be written as part of a blob, a block must have been successfully written
 * to the server in a prior stageBlock operation. You can call commitBlockList to update a blob
 * by uploading only those blocks that have changed, then committing the new and existing
 * blocks together. Any blocks not specified in the block list and permanently deleted.
 * For more information, see the
 * <a href="https://docs.microsoft.com/rest/api/storageservices/put-block-list">Azure Docs</a>.
 * <p>
 * For more efficient bulk-upload scenarios, please refer to the {@link TransferManager} for convenience methods.
 *
 * @param base64BlockIDs
 *         A list of base64 encode {@code String}s that specifies the block IDs to be committed.
 *
 * @return Emits the successful response.
 *
 * @apiNote ## Sample Code \n
 * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blocks "Sample code for BlockBlobURL.commitBlockList")] \n
 * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java)
 */
public Single<BlockBlobCommitBlockListResponse> commitBlockList(List<String> base64BlockIDs) {
  return this.commitBlockList(base64BlockIDs, null, null, null, null);
}
origin: Azure/azure-storage-java

/**
 * Returns the list of blocks that have been uploaded as part of a block blob using the specified block list filter.
 * For more information, see the
 * <a href="https://docs.microsoft.com/rest/api/storageservices/get-block-list">Azure Docs</a>.
 *
 * @param listType
 *         Specifies which type of blocks to return.
 *
 * @return Emits the successful response.
 *
 * @apiNote ## Sample Code \n
 * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blocks "Sample code for BlockBlobURL.getBlockList")] \n
 * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java)
 */
public Single<BlockBlobGetBlockListResponse> getBlockList(BlockListType listType) {
  return this.getBlockList(listType, null, null);
}
origin: Azure/azure-storage-java

/**
 * Uploads the specified block to the block blob's "staging area" to be later committed by a call to
 * commitBlockList. For more information, see the
 * <a href="https://docs.microsoft.com/rest/api/storageservices/put-block">Azure Docs</a>.
 * <p>
 * Note that the data passed must be replayable if retries are enabled (the default). In other words, the
 * {@code Flowable} must produce the same data each time it is subscribed to.
 *
 * @param base64BlockID
 *         A Base64 encoded {@code String} that specifies the ID for this block. Note that all block ids for a given
 *         blob must be the same length.
 * @param data
 *         The data to write to the block. Note that this {@code Flowable} must be replayable if retries are enabled
 *         (the default). In other words, the Flowable must produce the same data each time it is subscribed to.
 * @param length
 *         The exact length of the data. It is important that this value match precisely the length of the data
 *         emitted by the {@code Flowable}.
 *
 * @return Emits the successful response.
 *
 * @apiNote ## Sample Code \n
 * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blocks "Sample code for BlockBlobURL.stageBlock")] \n
 * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java)
 */
public Single<BlockBlobStageBlockResponse> stageBlock(String base64BlockID, Flowable<ByteBuffer> data,
    long length) {
  return this.stageBlock(base64BlockID, data, length, null, null);
}
origin: Azure/azure-storage-java

return blockBlobURL.upload(data, file.size(), optionsReal.httpHeaders(),
    optionsReal.metadata(), optionsReal.accessConditions(), null)
    return blockBlobURL.stageBlock(blockId, data,
        count, optionsReal.accessConditions().leaseAccessConditions(), null)
        .map(x -> blockId).toObservable();
      blockBlobURL.commitBlockList(ids, optionsReal.httpHeaders(), optionsReal.metadata(),
          optionsReal.accessConditions(), null))
origin: com.microsoft.azure/azure-storage-blob

/**
 * Creates a new {@link BlockBlobURL} with the given pipeline.
 *
 * @param pipeline
 *         An {@link HttpPipeline} object to set.
 *
 * @return A {@link BlockBlobURL} object with the given pipeline.
 */
public BlockBlobURL withPipeline(HttpPipeline pipeline) {
  try {
    return new BlockBlobURL(new URL(this.storageClient.url()), pipeline);
  } catch (MalformedURLException e) {
    throw new RuntimeException(e);
  }
}
origin: Microsoft/azure-spring-boot

public static void deleteBlob(BlockBlobURL blockBlobURL) {
  logInfo("Start deleting file %s...", blockBlobURL.toURL());
  blockBlobURL.delete(null, null, null)
      .toCompletable()
      .doOnComplete(() -> logInfo("Blob %s is deleted.", blockBlobURL.toURL()))
      .doOnError(error -> logError("Failed to delete blob %s with error %s.",
          blockBlobURL.toURL(), error.getMessage()))
      .blockingAwait();
}
origin: Microsoft/azure-spring-boot

public static void downloadBlob(BlockBlobURL blockBlobURL, File downloadToFile) {
  logInfo("Start downloading file %s to %s...", blockBlobURL.toURL(), downloadToFile);
  FileUtils.deleteQuietly(downloadToFile);
  blockBlobURL.download(new BlobRange().withOffset(0).withCount(4 * 1024 * 1024L), null, false, null)
      .flatMapCompletable(
          response -> {
            final AsynchronousFileChannel channel = AsynchronousFileChannel
                .open(Paths.get(downloadToFile.getAbsolutePath()), StandardOpenOption.CREATE,
                    StandardOpenOption.WRITE);
        return FlowableUtil.writeFile(response.body(null), channel);
      })
      .doOnComplete(() -> logInfo("File is downloaded to %s.", downloadToFile))
      .doOnError(error -> logError("Failed to download file from blob %s with error %s.",
          blockBlobURL.toURL(), error.getMessage()))
      .blockingAwait();
}
origin: com.microsoft.azure/azure-storage-blob

/**
 * Creates a new block to be committed as part of a blob where the contents are read from a URL. For more
 * information, see the <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url">Azure Docs</a>.
 *
 * @param base64BlockID
 *         A Base64 encoded {@code String} that specifies the ID for this block. Note that all block ids for a given
 *         blob must be the same length.
 * @param sourceURL
 *         The url to the blob that will be the source of the copy.  A source blob in the same storage account can be
 *         authenticated via Shared Key. However, if the source is a blob in another account, the source blob must
 *         either be public or must be authenticated via a shared access signature. If the source blob is public, no
 *         authentication is required to perform the operation.
 * @param sourceRange
 *         {@link BlobRange}
 *
 * @return Emits the successful response.
 *
 * @apiNote ## Sample Code \n
 * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=block_from_url "Sample code for BlockBlobURL.stageBlockFromURL")]
 * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java)
 */
public Single<BlockBlobStageBlockFromURLResponse> stageBlockFromURL(String base64BlockID, URL sourceURL,
    BlobRange sourceRange) {
  return this.stageBlockFromURL(base64BlockID, sourceURL, sourceRange, null, null, null);
}
origin: com.microsoft.azure/azure-storage-blob

/**
 * Creates a new block blob, or updates the content of an existing block blob.
 * Updating an existing block blob overwrites any existing metadata on the blob. Partial updates are not
 * supported with PutBlob; the content of the existing blob is overwritten with the new content. To
 * perform a partial update of a block blob's, use PutBlock and PutBlockList.
 * For more information, see the
 * <a href="https://docs.microsoft.com/rest/api/storageservices/put-blob">Azure Docs</a>.
 * <p>
 * Note that the data passed must be replayable if retries are enabled (the default). In other words, the
 * {@code Flowable} must produce the same data each time it is subscribed to.
 * <p>
 * For more efficient bulk-upload scenarios, please refer to the {@link TransferManager} for convenience methods.
 *
 * @param data
 *         The data to write to the blob. Note that this {@code Flowable} must be replayable if retries are enabled
 *         (the default). In other words, the Flowable must produce the same data each time it is subscribed to.
 * @param length
 *         The exact length of the data. It is important that this value match precisely the length of the data
 *         emitted by the {@code Flowable}.
 *
 * @return Emits the successful response.
 *
 * @apiNote ## Sample Code \n
 * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=upload_download "Sample code for BlockBlobURL.upload")] \n
 * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java)
 */
public Single<BlockBlobUploadResponse> upload(Flowable<ByteBuffer> data, long length) {
  return this.upload(data, length, null, null, null, null);
}
origin: com.microsoft.azure/azure-storage-blob

return blockBlobURL.upload(data, file.size(), optionsReal.httpHeaders(),
    optionsReal.metadata(), optionsReal.accessConditions(), null)
    return blockBlobURL.stageBlock(blockId, data,
        count, optionsReal.accessConditions().leaseAccessConditions(), null)
        .map(x -> blockId).toObservable();
      blockBlobURL.commitBlockList(ids, optionsReal.httpHeaders(), optionsReal.metadata(),
          optionsReal.accessConditions(), null))
origin: Azure/azure-storage-java

/**
 * Creates a new {@link BlockBlobURL} with the given pipeline.
 *
 * @param pipeline
 *         An {@link HttpPipeline} object to set.
 *
 * @return A {@link BlockBlobURL} object with the given pipeline.
 */
public BlockBlobURL withPipeline(HttpPipeline pipeline) {
  try {
    return new BlockBlobURL(new URL(this.storageClient.url()), pipeline);
  } catch (MalformedURLException e) {
    throw new RuntimeException(e);
  }
}
origin: Azure/azure-storage-java

/**
 * Creates a new block to be committed as part of a blob where the contents are read from a URL. For more
 * information, see the <a href="https://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url">Azure Docs</a>.
 *
 * @param base64BlockID
 *         A Base64 encoded {@code String} that specifies the ID for this block. Note that all block ids for a given
 *         blob must be the same length.
 * @param sourceURL
 *         The url to the blob that will be the source of the copy.  A source blob in the same storage account can be
 *         authenticated via Shared Key. However, if the source is a blob in another account, the source blob must
 *         either be public or must be authenticated via a shared access signature. If the source blob is public, no
 *         authentication is required to perform the operation.
 * @param sourceRange
 *         {@link BlobRange}
 *
 * @return Emits the successful response.
 *
 * @apiNote ## Sample Code \n
 * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=block_from_url "Sample code for BlockBlobURL.stageBlockFromURL")]
 * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java)
 */
public Single<BlockBlobStageBlockFromURLResponse> stageBlockFromURL(String base64BlockID, URL sourceURL,
    BlobRange sourceRange) {
  return this.stageBlockFromURL(base64BlockID, sourceURL, sourceRange, null, null, null);
}
origin: Azure/azure-storage-java

/**
 * Creates a new block blob, or updates the content of an existing block blob.
 * Updating an existing block blob overwrites any existing metadata on the blob. Partial updates are not
 * supported with PutBlob; the content of the existing blob is overwritten with the new content. To
 * perform a partial update of a block blob's, use PutBlock and PutBlockList.
 * For more information, see the
 * <a href="https://docs.microsoft.com/rest/api/storageservices/put-blob">Azure Docs</a>.
 * <p>
 * Note that the data passed must be replayable if retries are enabled (the default). In other words, the
 * {@code Flowable} must produce the same data each time it is subscribed to.
 * <p>
 * For more efficient bulk-upload scenarios, please refer to the {@link TransferManager} for convenience methods.
 *
 * @param data
 *         The data to write to the blob. Note that this {@code Flowable} must be replayable if retries are enabled
 *         (the default). In other words, the Flowable must produce the same data each time it is subscribed to.
 * @param length
 *         The exact length of the data. It is important that this value match precisely the length of the data
 *         emitted by the {@code Flowable}.
 *
 * @return Emits the successful response.
 *
 * @apiNote ## Sample Code \n
 * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=upload_download "Sample code for BlockBlobURL.upload")] \n
 * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java)
 */
public Single<BlockBlobUploadResponse> upload(Flowable<ByteBuffer> data, long length) {
  return this.upload(data, length, null, null, null, null);
}
origin: com.microsoft.azure/azure-storage-blob

/**
 * Converts this BlobURL to a {@link BlockBlobURL} object. Note that this does not change the actual type of the
 * blob if it has already been created.
 *
 * @return A {@link BlockBlobURL} object.
 */
public BlockBlobURL toBlockBlobURL() {
  try {
    return new BlockBlobURL(new URL(this.storageClient.url()), super.storageClient.httpPipeline());
  } catch (MalformedURLException e) {
    throw new RuntimeException(e);
  }
}
origin: com.microsoft.azure/azure-storage-blob

/**
 * Returns the list of blocks that have been uploaded as part of a block blob using the specified block list filter.
 * For more information, see the
 * <a href="https://docs.microsoft.com/rest/api/storageservices/get-block-list">Azure Docs</a>.
 *
 * @param listType
 *         Specifies which type of blocks to return.
 *
 * @return Emits the successful response.
 *
 * @apiNote ## Sample Code \n
 * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blocks "Sample code for BlockBlobURL.getBlockList")] \n
 * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java)
 */
public Single<BlockBlobGetBlockListResponse> getBlockList(BlockListType listType) {
  return this.getBlockList(listType, null, null);
}
origin: Azure/azure-storage-java

/**
 * Writes a blob by specifying the list of block IDs that are to make up the blob.
 * In order to be written as part of a blob, a block must have been successfully written
 * to the server in a prior stageBlock operation. You can call commitBlockList to update a blob
 * by uploading only those blocks that have changed, then committing the new and existing
 * blocks together. Any blocks not specified in the block list and permanently deleted.
 * For more information, see the
 * <a href="https://docs.microsoft.com/rest/api/storageservices/put-block-list">Azure Docs</a>.
 * <p>
 * For more efficient bulk-upload scenarios, please refer to the {@link TransferManager} for convenience methods.
 *
 * @param base64BlockIDs
 *         A list of base64 encode {@code String}s that specifies the block IDs to be committed.
 *
 * @return Emits the successful response.
 *
 * @apiNote ## Sample Code \n
 * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blocks "Sample code for BlockBlobURL.commitBlockList")] \n
 * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java)
 */
public Single<BlockBlobCommitBlockListResponse> commitBlockList(List<String> base64BlockIDs) {
  return this.commitBlockList(base64BlockIDs, null, null, null, null);
}
origin: com.microsoft.azure/azure-storage-blob

/**
 * Uploads the specified block to the block blob's "staging area" to be later committed by a call to
 * commitBlockList. For more information, see the
 * <a href="https://docs.microsoft.com/rest/api/storageservices/put-block">Azure Docs</a>.
 * <p>
 * Note that the data passed must be replayable if retries are enabled (the default). In other words, the
 * {@code Flowable} must produce the same data each time it is subscribed to.
 *
 * @param base64BlockID
 *         A Base64 encoded {@code String} that specifies the ID for this block. Note that all block ids for a given
 *         blob must be the same length.
 * @param data
 *         The data to write to the block. Note that this {@code Flowable} must be replayable if retries are enabled
 *         (the default). In other words, the Flowable must produce the same data each time it is subscribed to.
 * @param length
 *         The exact length of the data. It is important that this value match precisely the length of the data
 *         emitted by the {@code Flowable}.
 *
 * @return Emits the successful response.
 *
 * @apiNote ## Sample Code \n
 * [!code-java[Sample_Code](../azure-storage-java/src/test/java/com/microsoft/azure/storage/Samples.java?name=blocks "Sample code for BlockBlobURL.stageBlock")] \n
 * For more samples, please see the [Samples file](%https://github.com/Azure/azure-storage-java/blob/master/src/test/java/com/microsoft/azure/storage/Samples.java)
 */
public Single<BlockBlobStageBlockResponse> stageBlock(String base64BlockID, Flowable<ByteBuffer> data,
    long length) {
  return this.stageBlock(base64BlockID, data, length, null, null);
}
origin: Azure/azure-storage-java

/**
 * Converts this BlobURL to a {@link BlockBlobURL} object. Note that this does not change the actual type of the
 * blob if it has already been created.
 *
 * @return A {@link BlockBlobURL} object.
 */
public BlockBlobURL toBlockBlobURL() {
  try {
    return new BlockBlobURL(new URL(this.storageClient.url()), super.storageClient.httpPipeline());
  } catch (MalformedURLException e) {
    throw new RuntimeException(e);
  }
}
origin: com.microsoft.azure/azure-storage-blob

/**
 * Creates a new {@link BlockBlobURL} object by concatenating the blobName to the end of
 * ContainerURL's URL. The new BlockBlobUrl uses the same request policy pipeline as the ContainerURL.
 * To change the pipeline, create the BlockBlobUrl and then call its WithPipeline method passing in the
 * desired pipeline object. Or, call this package's NewBlockBlobUrl instead of calling this object's
 * NewBlockBlobUrl method.
 *
 * @param blobName
 *         A {@code String} representing the name of the blob.
 *
 * @return A new {@link BlockBlobURL} object which references the blob with the specified name in this container.
 */
public BlockBlobURL createBlockBlobURL(String blobName) {
  blobName = safeURLEncode(blobName);
  try {
    return new BlockBlobURL(StorageURL.appendToURLPath(new URL(this.storageClient.url()), blobName),
        this.storageClient.httpPipeline());
  } catch (MalformedURLException e) {
    throw new RuntimeException(e);
  }
}
origin: Azure/azure-storage-java

/**
 * Creates a new {@link BlockBlobURL} object by concatenating the blobName to the end of
 * ContainerURL's URL. The new BlockBlobUrl uses the same request policy pipeline as the ContainerURL.
 * To change the pipeline, create the BlockBlobUrl and then call its WithPipeline method passing in the
 * desired pipeline object. Or, call this package's NewBlockBlobUrl instead of calling this object's
 * NewBlockBlobUrl method.
 *
 * @param blobName
 *         A {@code String} representing the name of the blob.
 *
 * @return A new {@link BlockBlobURL} object which references the blob with the specified name in this container.
 */
public BlockBlobURL createBlockBlobURL(String blobName) {
  blobName = safeURLEncode(blobName);
  try {
    return new BlockBlobURL(StorageURL.appendToURLPath(new URL(this.storageClient.url()), blobName),
        this.storageClient.httpPipeline());
  } catch (MalformedURLException e) {
    throw new RuntimeException(e);
  }
}
com.microsoft.azure.storage.blobBlockBlobURL

Javadoc

Represents a URL to a block blob. It may be obtained by direct construction or via the create method on a ContainerURL object. This class does not hold any state about a particular blob but is instead a convenient way of sending off appropriate requests to the resource on the service. Please refer to the Azure Docs for more information on block blobs.

Most used methods

  • <init>
    Creates a BlockBlobURL object pointing to the account specified by the URL and using the provided pi
  • commitBlockList
    Writes a blob by specifying the list of block IDs that are to make up the blob. In order to be writt
  • delete
  • download
  • getBlockList
    Returns the list of blocks that have been uploaded as part of a block blob using the specified block
  • stageBlock
    Uploads the specified block to the block blob's "staging area" to be later committed by a call to co
  • stageBlockFromURL
    Creates a new block to be committed as part of a blob where the contents are read from a URL. For mo
  • toURL
  • upload
    Creates a new block blob, or updates the content of an existing block blob. Updating an existing blo

Popular in Java

  • Making http requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • getApplicationContext (Context)
  • addToBackStack (FragmentTransaction)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now