本文整理汇总了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();
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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");
}
示例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");
}
示例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");
}
示例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");
}