Parse URI server authorith in Java

Description

The following code shows how to parse URI server authorith.

Example


// w  w  w .  j av  a  2  s .c om
import java.net.URI;

public class Main {

  public static void main(String args[]) throws Exception {

    URI u = new URI("//foo:bar");
    System.out.println(u.parseServerAuthority());    
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    Network »




NetworkInterface
URI
URL
HTTP
HTTP Read
IP
Socket
UDP
URL Encode