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[] argsthrows Exception {
        URL url = new URL("http://192.168.10.211:8080");
        HttpURLConnection connection = (HttpURLConnectionurl.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)

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US