@@ -88,7 +88,7 @@ public class AbfsConfiguration{
8888
8989 private final Configuration rawConfig ;
9090 private final String accountName ;
91- private final String fsName ;
91+ private String fsName ;
9292 // Service type identified from URL used to initialize FileSystem.
9393 private final AbfsServiceType fsConfiguredServiceType ;
9494 private final boolean isSecure ;
@@ -452,20 +452,17 @@ public class AbfsConfiguration{
452452 * Constructor for AbfsConfiguration for specified service type.
453453 * @param rawConfig used to initialize the configuration.
454454 * @param accountName the name of the azure storage account.
455- * @param fsName the name of the file system (container name).
456455 * @param fsConfiguredServiceType service type configured for the file system.
457456 * @throws IllegalAccessException if the field is not accessible.
458457 * @throws IOException if an I/O error occurs.
459458 */
460459 public AbfsConfiguration (final Configuration rawConfig ,
461460 String accountName ,
462- String fsName ,
463461 AbfsServiceType fsConfiguredServiceType )
464462 throws IllegalAccessException , IOException {
465463 this .rawConfig = ProviderUtils .excludeIncompatibleCredentialProviders (
466464 rawConfig , AzureBlobFileSystem .class );
467465 this .accountName = accountName ;
468- this .fsName = fsName ;
469466 this .fsConfiguredServiceType = fsConfiguredServiceType ;
470467 this .isSecure = getBoolean (FS_AZURE_SECURE_MODE , false );
471468
@@ -488,6 +485,24 @@ public AbfsConfiguration(final Configuration rawConfig,
488485 }
489486 }
490487
488+ /**
489+ * Constructor for AbfsConfiguration for retrieve the FsName.
490+ * @param rawConfig used to initialize the configuration.
491+ * @param accountName the name of the azure storage account.
492+ * @param fsName the name of the file system (container name).
493+ * @param fsConfiguredServiceType service type configured for the file system.
494+ * @throws IllegalAccessException if the field is not accessible.
495+ * @throws IOException if an I/O error occurs.
496+ */
497+ public AbfsConfiguration (final Configuration rawConfig ,
498+ String accountName ,
499+ String fsName ,
500+ AbfsServiceType fsConfiguredServiceType )
501+ throws IllegalAccessException , IOException {
502+ this (rawConfig , accountName , fsConfiguredServiceType );
503+ this .fsName = fsName ;
504+ }
505+
491506 /**
492507 * Constructor for AbfsConfiguration for default service type i.e. DFS.
493508 * @param rawConfig used to initialize the configuration.
@@ -497,7 +512,7 @@ public AbfsConfiguration(final Configuration rawConfig,
497512 */
498513 public AbfsConfiguration (final Configuration rawConfig , String accountName )
499514 throws IllegalAccessException , IOException {
500- this (rawConfig , accountName , EMPTY_STRING , AbfsServiceType .DFS );
515+ this (rawConfig , accountName , AbfsServiceType .DFS );
501516 }
502517
503518 /**
@@ -666,13 +681,11 @@ public int getInt(String key, int defaultValue) {
666681 * @throws IOException if parsing fails.
667682 */
668683 public String getPasswordString (String key ) throws IOException {
669- char [] passchars = rawConfig .getPassword (containerConf (key ));
670- if (passchars == null ) {
671- passchars = rawConfig .getPassword (accountConf (key ));
672- if (passchars == null ){
673- passchars = rawConfig .getPassword (key );
674- }
675- }
684+ char [] passchars = rawConfig .getPassword (containerConf (key )) != null ?
685+ rawConfig .getPassword (containerConf (key )) :
686+ rawConfig .getPassword (accountConf (key )) != null ?
687+ rawConfig .getPassword (accountConf (key )) :
688+ rawConfig .getPassword (key );
676689 if (passchars != null ) {
677690 return new String (passchars );
678691 }
0 commit comments