当前位置: 首页>>代码示例>>Java>>正文


Java AuthType.PLAIN属性代码示例

本文整理汇总了Java中com.fsck.k9.mail.AuthType.PLAIN属性的典型用法代码示例。如果您正苦于以下问题:Java AuthType.PLAIN属性的具体用法?Java AuthType.PLAIN怎么用?Java AuthType.PLAIN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.fsck.k9.mail.AuthType的用法示例。


在下文中一共展示了AuthType.PLAIN属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onManualSetup

private void onManualSetup() {
    String email = mEmailView.getText().toString();
    String[] emailParts = splitEmail(email);
    String user = email;
    String domain = emailParts[1];

    String password = null;
    String clientCertificateAlias = null;
    AuthType authenticationType;
    if (mClientCertificateCheckBox.isChecked()) {
        authenticationType = AuthType.EXTERNAL;
        clientCertificateAlias = mClientCertificateSpinner.getAlias();
    } else {
        authenticationType = AuthType.PLAIN;
        password = mPasswordView.getText().toString();
    }

    if (mAccount == null) {
        mAccount = Preferences.getPreferences(this).newAccount();
    }
    mAccount.setName(getOwnerName());
    mAccount.setEmail(email);

    // set default uris
    // NOTE: they will be changed again in AccountSetupAccountType!
    ServerSettings storeServer = new ServerSettings(ServerSettings.Type.IMAP, "mail." + domain, -1,
            ConnectionSecurity.SSL_TLS_REQUIRED, authenticationType, user, password, clientCertificateAlias);
    ServerSettings transportServer = new ServerSettings(ServerSettings.Type.SMTP, "mail." + domain, -1,
            ConnectionSecurity.SSL_TLS_REQUIRED, authenticationType, user, password, clientCertificateAlias);
    String storeUri = RemoteStore.createStoreUri(storeServer);
    String transportUri = TransportUris.createTransportUri(transportServer);
    mAccount.setStoreUri(storeUri);
    mAccount.setTransportUri(transportUri);

    setupFolderNames(domain);

    AccountSetupAccountType.actionSelectAccountType(this, mAccount, false);

    finish();
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:40,代码来源:AccountSetupBasics.java

示例2: get

public static AuthTypeAdapter get(Context context) {
    AuthType[] authTypes = new AuthType[]{AuthType.PLAIN, AuthType.CRAM_MD5, AuthType.EXTERNAL};
    AuthTypeHolder[] holders = new AuthTypeHolder[authTypes.length];
    for (int i = 0; i < authTypes.length; i++) {
        holders[i] = new AuthTypeHolder(authTypes[i], context.getResources());
    }
    AuthTypeAdapter authTypesAdapter = new AuthTypeAdapter(context,
            android.R.layout.simple_spinner_item, holders);
    authTypesAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    return authTypesAdapter;
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:11,代码来源:AuthTypeAdapter.java

示例3: testCreateStoreUriImapPrefix

@Test
public void testCreateStoreUriImapPrefix() {
    Map<String, String> extra = new HashMap<String, String>();
    extra.put("autoDetectNamespace", "false");
    extra.put("pathPrefix", "customPathPrefix");
    ServerSettings settings = new ServerSettings(ServerSettings.Type.IMAP, "server", 143,
            ConnectionSecurity.NONE, AuthType.PLAIN, "user", "pass", null, extra);

    String uri = RemoteStore.createStoreUri(settings);

    assertEquals("imap://PLAIN:user:[email protected]:143/0%7CcustomPathPrefix", uri);
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:12,代码来源:ImapStoreUriTest.java

示例4: testCreateStoreUriImapEmptyPrefix

@Test
public void testCreateStoreUriImapEmptyPrefix() {
    Map<String, String> extra = new HashMap<String, String>();
    extra.put("autoDetectNamespace", "false");
    extra.put("pathPrefix", "");
    ServerSettings settings = new ServerSettings(ServerSettings.Type.IMAP, "server", 143,
            ConnectionSecurity.NONE, AuthType.PLAIN, "user", "pass", null, extra);

    String uri = RemoteStore.createStoreUri(settings);

    assertEquals("imap://PLAIN:user:[email protected]:143/0%7C", uri);
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:12,代码来源:ImapStoreUriTest.java

示例5: testCreateStoreUriImapNoExtra

@Test
public void testCreateStoreUriImapNoExtra() {
    ServerSettings settings = new ServerSettings(ServerSettings.Type.IMAP, "server", 143,
            ConnectionSecurity.NONE, AuthType.PLAIN, "user", "pass", null);

    String uri = RemoteStore.createStoreUri(settings);

    assertEquals("imap://PLAIN:user:[email protected]:143/1%7C", uri);
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:9,代码来源:ImapStoreUriTest.java

示例6: testCreateStoreUriImapAutoDetectNamespace

@Test
public void testCreateStoreUriImapAutoDetectNamespace() {
    Map<String, String> extra = new HashMap<String, String>();
    extra.put("autoDetectNamespace", "true");

    ServerSettings settings = new ServerSettings(ServerSettings.Type.IMAP, "server", 143,
            ConnectionSecurity.NONE, AuthType.PLAIN, "user", "pass", null, extra);

    String uri = RemoteStore.createStoreUri(settings);

    assertEquals("imap://PLAIN:user:[email protected]:143/1%7C", uri);
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:12,代码来源:ImapStoreUriTest.java

示例7: testCreateDecodeStoreUriWithSpecialCharactersInUsernameAndPassword

@Test
public void testCreateDecodeStoreUriWithSpecialCharactersInUsernameAndPassword() {
    ServerSettings settings = new ServerSettings(ServerSettings.Type.IMAP, "server", 143,
            ConnectionSecurity.NONE, AuthType.PLAIN, "[email protected]:n", "[email protected]:rd%", null, null);

    String uri = RemoteStore.createStoreUri(settings);

    assertEquals("imap://PLAIN:user%2540doma%253An:p%2540ssw%253Ard%[email protected]:143/1%7C", uri);

    ServerSettings outSettings = RemoteStore.decodeStoreUri(uri);

    assertEquals("[email protected]:n", outSettings.username);
    assertEquals("[email protected]:rd%", outSettings.password);
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:14,代码来源:ImapStoreUriTest.java

示例8: createUri_withSetting_shouldProvideUri

@Test
public void createUri_withSetting_shouldProvideUri() {
    ServerSettings serverSettings = new ServerSettings(Type.WebDAV, "example.org", 123456, ConnectionSecurity.NONE,
            AuthType.PLAIN, "user", "password", null);

    String result = WebDavStore.createUri(serverSettings);

    assertEquals("webdav://user:[email protected]:123456/%7C%7C", result);
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:9,代码来源:WebDavStoreTest.java

示例9: createUri_withSettingsWithTLS_shouldProvideSSLUri

@Test
public void createUri_withSettingsWithTLS_shouldProvideSSLUri() {
    ServerSettings serverSettings = new ServerSettings(Type.WebDAV, "example.org", 123456,
            ConnectionSecurity.SSL_TLS_REQUIRED, AuthType.PLAIN, "user", "password", null);

    String result = WebDavStore.createUri(serverSettings);

    assertEquals("webdav+ssl+://user:[email protected]:123456/%7C%7C", result);
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:9,代码来源:WebDavStoreTest.java

示例10: createUri_withSSLTLS_required_shouldProduceSSLUri

@Test
public void createUri_withSSLTLS_required_shouldProduceSSLUri() {
    ServerSettings settings = new ServerSettings(Type.POP3, "server", 12345, ConnectionSecurity.SSL_TLS_REQUIRED,
            AuthType.PLAIN, "user", "password", null);

    String uri = Pop3Store.createUri(settings);

    assertEquals(uri, "pop3+ssl+://PLAIN:user:[email protected]:12345");
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:9,代码来源:Pop3StoreTest.java

示例11: createUri_withSTARTTLSRequired_shouldProduceTLSUri

@Test
public void createUri_withSTARTTLSRequired_shouldProduceTLSUri() {
    ServerSettings settings = new ServerSettings(Type.POP3, "server", 12345, ConnectionSecurity.STARTTLS_REQUIRED,
            AuthType.PLAIN, "user", "password", null);

    String uri = Pop3Store.createUri(settings);

    assertEquals(uri, "pop3+tls+://PLAIN:user:[email protected]:12345");
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:9,代码来源:Pop3StoreTest.java

示例12: createUri_withNONE_shouldProducePop3Uri

@Test
public void createUri_withNONE_shouldProducePop3Uri() {
    ServerSettings settings = new ServerSettings(Type.POP3, "server", 12345, ConnectionSecurity.NONE,
            AuthType.PLAIN, "user", "password", null);

    String uri = Pop3Store.createUri(settings);

    assertEquals(uri, "pop3://PLAIN:user:[email protected]:12345");
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:9,代码来源:Pop3StoreTest.java

示例13: createUri_withPLAIN_shouldProducePlainAuthUri

@Test
public void createUri_withPLAIN_shouldProducePlainAuthUri() {
    ServerSettings settings = new ServerSettings(Type.POP3, "server", 12345, ConnectionSecurity.NONE,
            AuthType.PLAIN, "user", "password", null);

    String uri = Pop3Store.createUri(settings);

    assertEquals(uri, "pop3://PLAIN:user:[email protected]:12345");
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:9,代码来源:Pop3StoreTest.java


注:本文中的com.fsck.k9.mail.AuthType.PLAIN属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。