HttpURLConnection GetPermission() Example
Returns a permission object representing the permission necessary to make the connection represented by this object.
HttpURLConnectionclass GetPermission() method example. This example shows you how to use GetPermission() method.This method Returns a permission object representing the permission necessary to make the connection represented by this object.
Here is the code:-
/*
* @Program that Returns a permission object representing the permission
necessary to make the connection represented by this object.
* GetPermission.java
* Author:-RoseIndia Team
* Date:-25-Jun-2008
*/
import java.net.*;
public class GetPermission {
public static void main(String[] args) throws Exception {
URL url = new URL("http://192.168.10.211:8080");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
//Returns a permission object representing the permission
System.out.println("Permission object is: "+connection.getPermission());
}
} |
Output of the program:-
| Permission object is: (java.net.SocketPermission 192.168.10.211:8080 connect,resolve) |
|