Java Local Address Get getLocalAddress(int port)

Here you can find the source of getLocalAddress(int port)

Description

get Local Address

License

Open Source License

Declaration

public static URL getLocalAddress(int port) 

Method Source Code


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

import java.net.*;

public class Main {
    public static URL getLocalAddress(int port) {
        try {//from w ww  . j  a  v  a  2 s. c  om
            return new URI("http://localhost:" + port).toURL();
        } catch (URISyntaxException | MalformedURLException e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. getLocalAddress()
  2. getLocalAddress()
  3. getLocalAddress(final String start, final String end)
  4. getLocalAddress(int port)
  5. getLocalAddress(int port)
  6. getLocalAddress(String adaptorName)
  7. getLocalAddress(String filter)
  8. getLocalAddress0()
  9. getLocalAddressAsString()