public class ExoUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String[] |
WRONG_CLOUD_URLS |
Constructor and Description |
---|
ExoUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
capitalize(String str)
Capitalizes the 1st character of the given string
|
static String |
encodeDocumentUrl(String urlString) |
static String |
getAccountNameFromURL(String url,
String defaultName)
Extract a name from a Server URL by keeping the 1st part of the FQDN,
between the protocol and the first dot or the end of the URL.
|
static boolean |
isCorrectIPAddress(String ip)
Check whether an IP address is correct using Patterns.IP_ADDRESS.
|
static boolean |
isDocumentUrlValid(String str) |
static boolean |
isEmailValid(String email)
Validate an email address with
http://developer.android.com/reference/android
/util/Patterns.html#EMAIL_ADDRESS
|
static boolean |
isServerNameValid(String serverName)
Verifies that an account name contains allowed characters only.
|
static boolean |
isURLForbidden(String url)
Check whether a given URL is forbidden or not.
URL cannot be one of "http://exoplatform.net", "http://wks-acc.exoplatform.org", "http://netstg.exoplatform.org" |
static boolean |
isUrlValid(String url)
Validate an URL with pattern
http://developer.android.com/reference/android/util/Patterns.html#WEB_URL
or #IP_ADDRESS
|
static boolean |
isUsernameValid(String username)
Verifies that an account username contains allowed characters only.
|
static void |
setLoadingItem(android.view.MenuItem loadingItem,
boolean loading) |
static String |
stripUrl(String url)
Removes unnecessary parts of the given URL.
The returned URL has the format: http(s)://host(:port) |
public static final String[] WRONG_CLOUD_URLS
public static boolean isUrlValid(String url)
url
- The URL to validatepublic static boolean isDocumentUrlValid(String str)
public static String stripUrl(String url)
url
- The URL to reformat.public static boolean isServerNameValid(String serverName)
serverName
- the server name to verifypublic static boolean isUsernameValid(String username)
username
- the username to verifypublic static boolean isEmailValid(String email)
email
- public static boolean isURLForbidden(String url)
url
- the URL to checkpublic static String getAccountNameFromURL(String url, String defaultName)
url
- the Server URLdefaultName
- a default name in case it is impossible to extractpublic static boolean isCorrectIPAddress(String ip)
ip
- to checkpublic static String capitalize(String str)
str
- the String to capitalizepublic static void setLoadingItem(android.view.MenuItem loadingItem, boolean loading)
Copyright © 2003–2016 eXo Platform SAS. All rights reserved.