Skip to content

Commit 40f3ea9

Browse files
authored
Azure path to blob client public (Azure#19310)
* Made AzurePath.toBlobClient public * Changelog * Updated javadoc * Checkstyle
1 parent d69bb62 commit 40f3ea9

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

sdk/storage/azure-storage-blob-nio/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Release History
22

33
## 12.0.0-beta.4 (Unreleased)
4+
- Made AzurePath.toBlobClient public
45
- Added support for Azurite
56
- Change FileSystem configuration to accept an endpoint and credential types instead of a string for the account name, key, and token
67

sdk/storage/azure-storage-blob-nio/src/main/java/com/azure/storage/blob/nio/AzurePath.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -708,12 +708,19 @@ public int hashCode() {
708708
return Objects.hash(parentFileSystem, pathString);
709709
}
710710

711-
/*
712-
We don't store the blob client because unlike other types in this package, a Path does not actually indicate the
713-
existence or even validity of any remote resource. It is purely a representation of a path. Therefore, we do not
714-
construct the client or perform any validation until it is requested.
711+
/**
712+
* Returns a {@link BlobClient} which references a blob pointed to by this path. Note that this does not guarantee
713+
* the existence of the blob at this location.
714+
*
715+
* @return a {@link BlobClient}.
716+
* @throws IOException If the path only contains a root component or is empty
715717
*/
716-
BlobClient toBlobClient() throws IOException {
718+
public BlobClient toBlobClient() throws IOException {
719+
/*
720+
We don't store the blob client because unlike other types in this package, a Path does not actually indicate the
721+
existence or even validity of any remote resource. It is purely a representation of a path. Therefore, we do not
722+
construct the client or perform any validation until it is requested.
723+
*/
717724
// Converting to an absolute path ensures there is a container to operate on even if it is the default.
718725
// Normalizing ensures the path is clean.
719726
Path root = this.normalize().toAbsolutePath().getRoot();

0 commit comments

Comments
 (0)