XAzureStorage.parse constructor

XAzureStorage.parse(
  1. String connectionString
)

Initialize with connection string.

Implementation

XAzureStorage.parse(String connectionString) {
  try {
    Map<String, String> m = {};
    var items = connectionString.split(';');
    for (var item in items) {
      var i = item.indexOf('=');
      var key = item.substring(0, i);
      var val = item.substring(i + 1);
      m[key] = val;
    }
    config = m;

    if (config.containsKey(accountMainKey)) {
      accountKey = base64Decode(config[accountMainKey]!);
    }
  } catch (e) {
    throw Exception('Parse error.');
  }
}