URI GetAuthority() Example
Returns the decoded authority component of this URI.
URIclass GetAuthority() method example. This example shows you how to use GetAuthority() method.This method Returns the decoded authority component of this URI.
Here is the code:-
/**
* @Program that Returns the decoded authority component of this URI.
* GetAuthority.java
* Author:-RoseIndia Team
* Date:-23-jun-2008
*/
import java.net.*;
public class GetAuthority {
public static void main(String[] args) throws Exception{
URI u = new URI("http://roseindia.net/j2se/1.3");
//Returns the decoded authority component of this URI.
String s=u.getAuthority();
System.out.println("Decoded authority component of this URI: "+s);
}
} |
Output of the program:-
| Decoded authority component of this URI: roseindia.net |
|