/** * 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); } }
/** * 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); } }
/** * 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); } }
/** * 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); } }
/** * 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); } }
/** * 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); } }
/** * Creates a new {@link BlockBlobURL} with the given snapshot. * * @param snapshot * A {@code String} of the snapshot identifier. * * @return A {@link BlockBlobURL} object with the given pipeline. */ public BlockBlobURL withSnapshot(String snapshot) throws MalformedURLException, UnknownHostException { BlobURLParts blobURLParts = URLParser.parse(new URL(this.storageClient.url())); blobURLParts.withSnapshot(snapshot); return new BlockBlobURL(blobURLParts.toURL(), super.storageClient.httpPipeline()); }
/** * Creates a new {@link BlockBlobURL} with the given snapshot. * * @param snapshot * A {@code String} of the snapshot identifier. * * @return A {@link BlockBlobURL} object with the given pipeline. */ public BlockBlobURL withSnapshot(String snapshot) throws MalformedURLException, UnknownHostException { BlobURLParts blobURLParts = URLParser.parse(new URL(this.storageClient.url())); blobURLParts.withSnapshot(snapshot); return new BlockBlobURL(blobURLParts.toURL(), super.storageClient.httpPipeline()); }