Java URI to extractHostAddress(String uri)

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

Description

extract Host Address

License

Open Source License

Declaration

public static String extractHostAddress(String uri) throws MalformedURLException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.net.MalformedURLException;

import java.net.URL;

public class Main {
    public static String extractHostAddress(String uri) throws MalformedURLException {
        URL url = new URL(uri);
        return url.getProtocol() + "://" + url.getHost() + ":" + url.getPort();
    }// www.  j a va  2  s.c  o  m
}

Related

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