BackupImapStore extends ImapStore { public static boolean isValidUri(String uri) { if (TextUtils.isEmpty(uri)) return false; Uri parsed = Uri.parse(uri); return parsed != null && !TextUtils.isEmpty(parsed.getAuthority()) && !TextUtils.isEmpty(parsed.getHost()) && !TextUtils.isEmpty(parsed.getScheme()) && ( "imap".equalsIgnoreCase(parsed.getScheme()) || "imap+ssl+".equalsIgnoreCase(parsed.getScheme()) || "imap+tls+".equalsIgnoreCase(parsed.getScheme()) ); } BackupImapStore(final Context context, final String uri,
                           boolean trustAllCertificates); BackupFolder getFolder(DataType type, DataTypePreferences preferences); void closeFolders(); @Override String toString(); String getStoreUriForLogging(); String getStoreUri(); static boolean isValidImapFolder(String imapFolder); static boolean isValidUri(String uri);  }
@Test public void shouldTestForValidUri() throws Exception { assertThat(isValidUri("imap+ssl+: assertThat(isValidUri("imap: assertThat(isValidUri("imap+ssl+: assertThat(isValidUri("imap+ssl: assertThat(isValidUri("imap+tls+: assertThat(isValidUri("imap+tls: assertThat(isValidUri("imap: assertThat(isValidUri("http: }