Name
NetPermission
Synopsis
This class is a
java.security.Permission that represents various
permissions required for Java’s URL-based networking
system. See also SocketPermission, which
represents permissions to perform lower-level networking operations.
A NetPermission is defined solely by its name; no
actions list is required or supported. As of Java 1.2, there are
three NetPermission
targets
defined: “setDefaultAuthenticator”
is required to call Authenticator.setDefault(
)
;
“requestPasswordAuthentication” to
call Authenticator.requestPasswordAuthentication(
)
; and
“specifyStreamHandler” to
explicitly pass a URLStreamHandler object to the
URL( ) constructor. The target
“*” is a
wildcard that represents all defined
NetPermission targets.
System administrators configuring security policies must be familiar with this class and the permissions it represents. System programmers may use this class, but application programmers never need to use it explicitly.
Figure 12-13. java.net.NetPermission
public final class NetPermission extends java.security.BasicPermission { // Public Constructors public NetPermission(String name); public NetPermission(String name, String actions); }
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access