8181 * {@link FileSystemProvider}.
8282 * <p>
8383 * The scheme for this provider is {@code "azb"}, and the format of the URI to identify an {@code AzureFileSystem} is
84- * {@code "azb://?account=<accountName >"}. The name of the Storage account is used to uniquely identify the file
85- * system .
84+ * {@code "azb://?endpoint=<endpoing >"}. The endpoint of the Storage account is used to uniquely identify the
85+ * filesystem .
8686 * <p>
8787 * An {@link AzureFileSystem} is backed by an account. An {@link AzureFileStore} is backed by a container. Any number of
8888 * containers may be specified as file stores upon creation of the file system. When a file system is created,
9696 * types. Any entries not listed here will be ignored. Note that {@link AzureFileSystem} has public constants defined
9797 * for each of the keys for convenience.
9898 * <ul>
99- * <li>{@code AzureStorageAccountKey :}{@link String }</li>
100- * <li>{@code AzureStorageSasToken :}{@link String }</li>
99+ * <li>{@code AzureStorageSharedKeyCredential :}{@link com.azure.storage.common.StorageSharedKeyCredential }</li>
100+ * <li>{@code AzureStorageSasTokenCredential :}{@link com.azure.core.credential.AzureSasCredential }</li>
101101 * <li>{@code AzureStorageHttpLogDetailLevel:}{@link com.azure.core.http.policy.HttpLogDetailLevel}</li>
102102 * <li>{@code AzureStorageMaxTries:}{@link Integer}</li>
103103 * <li>{@code AzureStorageTryTimeout:}{@link Integer}</li>
110110 * <li>{@code AzureStoragePutBlobThreshold:}{@link Long}</li>
111111 * <li>{@code AzureStorageMaxConcurrencyPerRequest:}{@link Integer}</li>
112112 * <li>{@code AzureStorageDownloadResumeRetries:}{@link Integer}</li>
113- * <li>{@code AzureStorageUseHttps:}{@link Boolean}</li>
114113 * <li>{@code AzureStorageFileStores:}{@link String}</li>
115114 * </ul>
116115 * <p>
117116 * Either an account key or a sas token must be specified. If both are provided, the account key will be preferred. If
118117 * a sas token is specified, the customer must take care that it has appropriate permissions to perform the actions
119- * demanded of the file system in a given workflow, including the initial connection check specified above. Furthermore,
120- * it must have an expiry time that lasts at least until the file system is closed as there is no token refresh offered
121- * at this time. The same token will be applied to all containers.
118+ * demanded of the file system in a given workflow, including the initial connection check specified above. The same
119+ * token will be applied to all operations.
122120 * <p>
123121 * An iterable of file stores must also be provided; each entry should simply be the name of a container. The first
124122 * container listed will be considered the default file store and the root directory of which will be the file system's
@@ -160,7 +158,7 @@ public final class AzureFileSystemProvider extends FileSystemProvider {
160158 */
161159 public static final String CACHE_CONTROL = "Cache-Control" ;
162160
163- private static final String ACCOUNT_QUERY_KEY = "account " ;
161+ private static final String ENDPOINT_QUERY_KEY = "endpoint " ;
164162 private static final int COPY_TIMEOUT_SECONDS = 30 ;
165163 private static final Set <OpenOption > OUTPUT_STREAM_DEFAULT_OPTIONS =
166164 Collections .unmodifiableSet (new HashSet <>(Arrays .asList (StandardOpenOption .CREATE ,
@@ -198,7 +196,7 @@ public String getScheme() {
198196 /**
199197 * Constructs a new FileSystem object identified by a URI.
200198 * <p>
201- * The format of a {@code URI} identifying a file system is {@code "azb://?account=<accountName >"}.
199+ * The format of a {@code URI} identifying a file system is {@code "azb://?endpoint=<endpoint >"}.
202200 * <p>
203201 * Once closed, a file system with the same identifier may be reopened.
204202 *
@@ -213,22 +211,22 @@ public String getScheme() {
213211 */
214212 @ Override
215213 public FileSystem newFileSystem (URI uri , Map <String , ?> config ) throws IOException {
216- String accountName = extractAccountName (uri );
214+ String endpoint = extractAccountEndpoint (uri );
217215
218- if (this .openFileSystems .containsKey (accountName )) {
219- throw LoggingUtility .logError (this .logger , new FileSystemAlreadyExistsException ("Name: " + accountName ));
216+ if (this .openFileSystems .containsKey (endpoint )) {
217+ throw LoggingUtility .logError (this .logger , new FileSystemAlreadyExistsException ("Name: " + endpoint ));
220218 }
221219
222- AzureFileSystem afs = new AzureFileSystem (this , accountName , config );
223- this .openFileSystems .put (accountName , afs );
220+ AzureFileSystem afs = new AzureFileSystem (this , endpoint , config );
221+ this .openFileSystems .put (endpoint , afs );
224222
225223 return afs ;
226224 }
227225
228226 /**
229227 * Returns an existing FileSystem created by this provider.
230228 * <p>
231- * The format of a {@code URI} identifying an file system is {@code "azb://?account =<accountName >"}.
229+ * The format of a {@code URI} identifying an file system is {@code "azb://?endpoint =<endpoint >"}.
232230 * <p>
233231 * Trying to retrieve a closed file system will throw a {@link FileSystemNotFoundException}. Once closed, a
234232 * file system with the same identifier may be reopened.
@@ -241,11 +239,11 @@ public FileSystem newFileSystem(URI uri, Map<String, ?> config) throws IOExcepti
241239 */
242240 @ Override
243241 public FileSystem getFileSystem (URI uri ) {
244- String accountName = extractAccountName (uri );
245- if (!this .openFileSystems .containsKey (accountName )) {
246- throw LoggingUtility .logError (this .logger , new FileSystemNotFoundException ("Name: " + accountName ));
242+ String endpoint = extractAccountEndpoint (uri );
243+ if (!this .openFileSystems .containsKey (endpoint )) {
244+ throw LoggingUtility .logError (this .logger , new FileSystemNotFoundException ("Name: " + endpoint ));
247245 }
248- return this .openFileSystems .get (accountName );
246+ return this .openFileSystems .get (endpoint );
249247 }
250248
251249 /**
@@ -1133,29 +1131,29 @@ void closeFileSystem(String fileSystemName) {
11331131 this .openFileSystems .remove (fileSystemName );
11341132 }
11351133
1136- private String extractAccountName (URI uri ) {
1134+ private String extractAccountEndpoint (URI uri ) {
11371135 if (!uri .getScheme ().equals (this .getScheme ())) {
11381136 throw LoggingUtility .logError (this .logger , new IllegalArgumentException (
11391137 "URI scheme does not match this provider" ));
11401138 }
11411139 if (CoreUtils .isNullOrEmpty (uri .getQuery ())) {
11421140 throw LoggingUtility .logError (this .logger , new IllegalArgumentException ("URI does not contain a query "
1143- + "component. FileSystems require a URI of the format \" azb://?account=<account_name >\" ." ));
1141+ + "component. FileSystems require a URI of the format \" azb://?endpoint=<account_endpoint >\" ." ));
11441142 }
11451143
1146- String accountName = Flux .fromArray (uri .getQuery ().split ("&" ))
1147- .filter (s -> s .startsWith (ACCOUNT_QUERY_KEY + "=" ))
1144+ String endpoint = Flux .fromArray (uri .getQuery ().split ("&" ))
1145+ .filter (s -> s .startsWith (ENDPOINT_QUERY_KEY + "=" ))
11481146 .switchIfEmpty (Mono .error (LoggingUtility .logError (this .logger , new IllegalArgumentException (
1149- "URI does not contain an \" " + ACCOUNT_QUERY_KEY + "=\" parameter. FileSystems require a URI "
1150- + "of the format \" azb://?account=<account_name >\" " ))))
1151- .map (s -> s .substring (ACCOUNT_QUERY_KEY .length () + 1 ))
1147+ "URI does not contain an \" " + ENDPOINT_QUERY_KEY + "=\" parameter. FileSystems require a URI "
1148+ + "of the format \" azb://?endpoint=<endpoint >\" " ))))
1149+ .map (s -> s .substring (ENDPOINT_QUERY_KEY .length () + 1 )) // Trim the query key and =
11521150 .blockLast ();
11531151
1154- if (CoreUtils .isNullOrEmpty (accountName )) {
1155- throw LoggingUtility .logError (logger , new IllegalArgumentException ("No account name provided in URI"
1152+ if (CoreUtils .isNullOrEmpty (endpoint )) {
1153+ throw LoggingUtility .logError (logger , new IllegalArgumentException ("No account endpoint provided in URI"
11561154 + " query." ));
11571155 }
11581156
1159- return accountName ;
1157+ return endpoint ;
11601158 }
11611159}
0 commit comments