/** * Gets the blob name from the URI. * * @param inURI * the resource address * @param usePathStyleUris * a value indicating if the address is a path style uri. * @return the blobs name * @throws URISyntaxException */ public static String getBlobNameFromURI(final URI inURI, final boolean usePathStyleUris) throws URISyntaxException { return Utility.safeRelativize(new URI(getContainerURI(new StorageUri(inURI), usePathStyleUris).getPrimaryUri() .toString().concat("/")), inURI); }
/** * Gets the blob name from the URI. * * @param inURI * the resource address * @param usePathStyleUris * a value indicating if the address is a path style uri. * @return the blobs name * @throws URISyntaxException */ public static String getBlobNameFromURI(final URI inURI, final boolean usePathStyleUris) throws URISyntaxException { return Utility.safeRelativize(new URI(getContainerURI(new StorageUri(inURI), usePathStyleUris).getPrimaryUri() .toString().concat("/")), inURI); }
/** * Returns the blob's container. * * @return A {@link CloudBlobContainer} object that represents the container of the blob. * @throws StorageException * If a storage service error occurred. * @throws URISyntaxException * If the resource URI is invalid. */ @Override public final CloudBlobContainer getContainer() throws StorageException, URISyntaxException { if (this.container == null) { final StorageUri containerURI = PathUtility.getContainerURI(this.getStorageUri(), this.blobServiceClient.isUsePathStyleUris()); this.container = new CloudBlobContainer(containerURI, this.blobServiceClient.getCredentials()); } return this.container; }
/** * Returns the blob's container. * * @return A {@link CloudBlobContainer} object that represents the container of the blob. * @throws StorageException * If a storage service error occurred. * @throws URISyntaxException * If the resource URI is invalid. */ @Override public final CloudBlobContainer getContainer() throws StorageException, URISyntaxException { if (this.container == null) { final StorageUri containerURI = PathUtility.getContainerURI(this.getStorageUri(), this.blobServiceClient.isUsePathStyleUris()); this.container = new CloudBlobContainer(containerURI, this.blobServiceClient.getCredentials()); } return this.container; }