Tabnine Logo
InternetDomainName.name
Code IndexAdd Tabnine to your IDE (free)

How to use
name
method
in
com.google.common.net.InternetDomainName

Best Java code snippets using com.google.common.net.InternetDomainName.name (Showing top 12 results out of 315)

origin: stackoverflow.com

 final InternetDomainName topPrivateDomain = InternetDomainName.from(uriHost).topPrivateDomain();
topPrivateDomain.name();
origin: org.netpreserve.commons/commons-web

public static String hostToPublicSuffix(String host) {
  InternetDomainName idn;

  try {
    idn = InternetDomainName.fromLenient(host);
  } catch(IllegalArgumentException e) {
    return host;
  }
  InternetDomainName tmp = idn.publicSuffix();
  if(tmp == null) {
    return host;
  }
  String pubSuff = tmp.name();
  int idx = host.lastIndexOf(".", host.length() - (pubSuff.length()+2));
  if(idx == -1) {
    return host;
  }
  return host.substring(idx+1);
}

origin: jvelo/mayocat-shop

private String extractSlugFromHost(String host)
{
  String rootDomain;
  String siteName = siteSettings.getWebDomainName().or(siteSettings.getDomainName());
  if (Strings.emptyToNull(siteName) == null) {
    InternetDomainName domainName = InternetDomainName.from(host);
    if (domainName.hasPublicSuffix()) {
      // Domain is under a valid TLD, extract the TLD + first child
      rootDomain = domainName.topPrivateDomain().name();
    } else if (host.indexOf(".") > 0 && host.indexOf(".") < host.length()) {
      // Otherwise, best guess : strip everything before the first dot.
      rootDomain = host.substring(host.indexOf(".") + 1);
    } else {
      rootDomain = host;
    }
  } else {
    rootDomain = StringUtils.substringBefore(siteSettings.getDomainName(), ":");
  }
  if (host.indexOf("." + rootDomain) > 0) {
    return host.substring(0, host.indexOf("." + rootDomain));
  } else {
    return host;
  }
}
origin: jclouds/legacy-jclouds

  @Override
  @SuppressWarnings("unchecked")
  public <R extends HttpRequest> R bindToRequest(R request, Object payload) {
   checkNotNull(payload, "hostprefix");
   checkArgument(isValid(request.getEndpoint().getHost()), "this is only valid for hostnames: " + request);
   InternetDomainName name = from(request.getEndpoint().getHost()).child(payload.toString());
   return (R) request.toBuilder().endpoint(uriBuilder(request.getEndpoint()).host(name.name()).build()).build();
  }
}
origin: org.jclouds/jclouds-core

  @Override
  @SuppressWarnings("unchecked")
  public <R extends HttpRequest> R bindToRequest(R request, Object payload) {
   checkNotNull(payload, "hostprefix");
   checkArgument(isValid(request.getEndpoint().getHost()), "this is only valid for hostnames: " + request);
   InternetDomainName name = from(request.getEndpoint().getHost()).child(payload.toString());
   return (R) request.toBuilder().endpoint(uriBuilder(request.getEndpoint()).host(name.name()).build()).build();
  }
}
origin: org.hudsonci.lib.guava/guava

return new HostSpecifier(domain.name());
origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

return new HostSpecifier(domain.name());
origin: com.atlassian.bundles/guava

return new HostSpecifier(domain.name());
origin: at.bestsolution.efxclipse.eclipse/com.google.guava

return new HostSpecifier(domain.name());
origin: com.ning.billing/killbill-osgi-bundles-jruby

return new HostSpecifier(domain.name());
origin: com.ning.billing/killbill-osgi-bundles-analytics

return new HostSpecifier(domain.name());
origin: org.sonatype.sisu/sisu-guava

return new HostSpecifier(domain.name());
com.google.common.netInternetDomainNamename

Javadoc

The full domain name, converted to lower case.

Popular methods of InternetDomainName

  • from
    Returns an instance of InternetDomainName after lenient validation. Specifically, validation against
  • toString
    Returns the domain name, normalized to all lower case.
  • hasPublicSuffix
    Indicates whether this domain name ends in a #isPublicSuffix(), including if it is a public suffix i
  • isValid
    Indicates whether the argument is a syntactically valid domain name using lenient validation. Specif
  • isUnderPublicSuffix
    Indicates whether this domain name ends in a #isPublicSuffix(), while not being a public suffix itse
  • isTopPrivateDomain
    Indicates whether this domain name is composed of exactly one subdomain component followed by a #isP
  • hasParent
    Indicates whether this domain is composed of two or more parts.
  • <init>
    Private constructor used to implement #ancestor(int). Argument parts are assumed to be valid, as the
  • ancestor
    Returns the ancestor of the current domain at the given number of levels "higher" (rightward) in the
  • validatePart
    Helper method for #validateSyntax(List). Validates that one part of a domain name is valid.
  • validateSyntax
    Validation method used by to ensure that the domain name is syntactically valid according to RFC 103
  • topPrivateDomain
    Returns the portion of this domain name that is one level beneath the public suffix. For example, fo
  • validateSyntax,
  • topPrivateDomain,
  • findPublicSuffix,
  • matchesWildcardPublicSuffix,
  • parts,
  • child,
  • hasRegistrySuffix,
  • isTopDomainUnderRegistrySuffix,
  • isUnderRegistrySuffix

Popular in Java

  • Creating JSON documents from java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • getResourceAsStream (ClassLoader)
  • getApplicationContext (Context)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now