java.lang.Object | |
↳ | com.urbanairship.js.Whitelist |
Defines a set of URL patterns to match a URL.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Whitelist() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean |
addEntry(String pattern)
Adds an entry to the whitelist for URL matching.
| ||||||||||
boolean |
isWhitelisted(String url)
Checks if a given URL is whitelisted or not.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Adds an entry to the whitelist for URL matching. Patterns must be defined with the following syntax:
<pattern> := '*' | <scheme>'://'<host><path> | <scheme>'://'<host> | 'file://'<path>
<scheme> := '*' | 'http' | 'https'
<host> := '*' | '*.'<any char except '/' and '*'>+ | <any char except '/' and '*'>+
<path> := '/'<any char>
Examples:
'*' will match any file, http, or https URL.
'*://www.urbanairship.com' will match any file, http, or https URL from www.urbanairship.com
'https://*.urbanairship.com' will match any https URL from urbanairship.com and any of its subdomains.
'file:///android_asset/*' will match any file in the android assets directory.
'http://urbanairship.com/foo/*.html' will match any url from urbanairship.com that ends in .html
and the path starts with /foo/.
Note: International domains should add an entry for both the ASCII and the unicode versions of
the domain.pattern | The URL pattern to add as a whitelist matcher. |
---|
true
if the pattern was added successfully, false
if the pattern
was unable to be added because it was either null or did not match the url-pattern syntax.
Checks if a given URL is whitelisted or not.
url | The URL. |
---|
true
If the URL matches any entries in the whitelist.