Code example for SocketPermission

0
    public java.security.Permission getPermission() throws IOException {
        int port = url.getPort();
        if (port < 0) {
            port = 80;
        } 
        return new SocketPermission(url.getHost() + ":" + port,
                "connect, resolve"); 
    } 
 
    /** 
     * Returns the request method which will be used to make the request to the 
     * remote HTTP server. All possible methods of this HTTP implementation is 
     * listed in the class definition. 
     * 
     * @return the request method string. 
     * @see #method 
     * @see #setRequestMethod 
     */ 
    public String getRequestMethod() {
        return method;
    }