Java URI to extractHostname(String uri)

Here you can find the source of extractHostname(String uri)

Description

extract Hostname

License

Apache License

Declaration

public static String extractHostname(String uri) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.net.URI;
import java.net.URISyntaxException;

public class Main {
    public static String extractHostname(String uri) {
        try {//from ww  w . j ava 2s  .c o m
            return extractHostname(new URI(uri));
        } catch (URISyntaxException e) {
            throw new IllegalArgumentException(e);
        }
    }

    @Deprecated
    public static String extractHostname(URI uri) {
        return uri.getHost();
    }
}

Related

  1. extractBaseUriFromRDF(String rdfString)
  2. extractContentDigest(URI contentDigest)
  3. extractForwardURIFrom(URI requestURI)
  4. extractFromURIParams(String paramsRule, String uri)
  5. extractHostAddress(String uri)
  6. extractLocalName(String uri)
  7. extractOntologyNameUriFromRDF(String rdfString, boolean generateURI)
  8. extractParamsFromURI(String uri)
  9. extractS3Key(URI uri)