Package com.facebook.capi.sdk.utils
Class URIUtils
java.lang.Object
com.facebook.capi.sdk.utils.URIUtils
URI Utils to help resolve ETLD+1 from input full URL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionComput the ETLD+1 value from input url domainprotected StringNormalize input host.Get ETLD+1 valueprotected StringgetHost()For unit testintGet sub domain indexprotected booleanisIPAddress(String host) Check if current host is an IP addressvoidReset the ETLD+1 value
-
Constructor Details
-
URIUtils
public URIUtils()Constructor -
URIUtils
Constructor with customized ETLDPlusOneResolver- Parameters:
etldPlus1Resolver- customized ETLDPlusOneResolver. Implement the ETLDPlusOneResolver interface.
-
URIUtils
Constructor with list of ETLD+1- Parameters:
domainList- List of ETLD+1 domains may associated with current input
-
-
Method Details
-
resetEtldPlusOne
public void resetEtldPlusOne()Reset the ETLD+1 value -
computeETLDPlusOneForHost
Comput the ETLD+1 value from input url domain- Parameters:
host- current URL domain. Eg. http://mytest.test.example.com- Returns:
- Resolved ETLD+1 value from current domain.eg. example.com
-
extractHostFromHttpHost
Normalize input host. Remove protocol if needed- Parameters:
host- full url- Returns:
- normalized URL
-
isIPAddress
Check if current host is an IP address- Parameters:
host- host name- Returns:
- true if input host name is an IP address. False otherwise.
-
getSubDomainIndex
public int getSubDomainIndex()Get sub domain index- Returns:
- subDomainIndex
-
getEtldPlusOne
Get ETLD+1 value- Returns:
- etld+1
-
getHost
For unit test- Returns:
- host
-