Example #1
0
  public ImapStore(
      StoreConfig storeConfig,
      TrustedSocketFactory trustedSocketFactory,
      ConnectivityManager connectivityManager,
      OAuth2TokenProvider oauthTokenProvider)
      throws MessagingException {
    super(storeConfig, trustedSocketFactory);

    ImapStoreSettings settings;
    try {
      settings = decodeUri(storeConfig.getStoreUri());
    } catch (IllegalArgumentException e) {
      throw new MessagingException("Error while decoding store URI", e);
    }

    host = settings.host;
    port = settings.port;

    connectionSecurity = settings.connectionSecurity;
    this.connectivityManager = connectivityManager;
    this.oauthTokenProvider = oauthTokenProvider;

    authType = settings.authenticationType;
    username = settings.username;
    password = settings.password;
    clientCertificateAlias = settings.clientCertificateAlias;

    // Make extra sure pathPrefix is null if "auto-detect namespace" is configured
    pathPrefix = (settings.autoDetectNamespace) ? null : settings.pathPrefix;

    folderNameCodec = FolderNameCodec.newInstance();
  }
  public Pop3Store(StoreConfig storeConfig, TrustedSocketFactory socketFactory)
      throws MessagingException {
    super(storeConfig, socketFactory);

    ServerSettings settings;
    try {
      settings = decodeUri(storeConfig.getStoreUri());
    } catch (IllegalArgumentException e) {
      throw new MessagingException("Error while decoding store URI", e);
    }

    mHost = settings.host;
    mPort = settings.port;

    mConnectionSecurity = settings.connectionSecurity;

    mUsername = settings.username;
    mPassword = settings.password;
    mClientCertificateAlias = settings.clientCertificateAlias;
    mAuthType = settings.authenticationType;
  }