Class URIUtils

java.lang.Object
com.facebook.capi.sdk.utils.URIUtils

public class URIUtils extends Object
URI Utils to help resolve ETLD+1 from input full URL
  • Constructor Details

    • URIUtils

      public URIUtils()
      Constructor
    • URIUtils

      public URIUtils(ETLDPlusOneResolver etldPlus1Resolver)
      Constructor with customized ETLDPlusOneResolver
      Parameters:
      etldPlus1Resolver - customized ETLDPlusOneResolver. Implement the ETLDPlusOneResolver interface.
    • URIUtils

      public URIUtils(List<String> domainList)
      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

      public String computeETLDPlusOneForHost(String host)
      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

      protected String extractHostFromHttpHost(String host)
      Normalize input host. Remove protocol if needed
      Parameters:
      host - full url
      Returns:
      normalized URL
    • isIPAddress

      protected boolean isIPAddress(String host)
      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

      public String getEtldPlusOne()
      Get ETLD+1 value
      Returns:
      etld+1
    • getHost

      protected String getHost()
      For unit test
      Returns:
      host