<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.4.2-rc) on Fri Jun 13 00:14:24 PDT 2003 -->
<TITLE>
NetPermission (Java 2 Platform SE v1.4.2)
</TITLE>
<META NAME="keywords" CONTENT="java.net.NetPermission class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="NetPermission (Java 2 Platform SE v1.4.2)";
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/NetPermission.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.4.2</b></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../java/net/MulticastSocket.html" title="class in java.net"><B>PREV CLASS</B></A>
<A HREF="../../java/net/NetworkInterface.html" title="class in java.net"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="NetPermission.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#methods_inherited_from_class_java.security.BasicPermission">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | METHOD</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
java.net</FONT>
<BR>
Class NetPermission</H2>
<PRE>
<A HREF="../../java/lang/Object.html" title="class in java.lang">java.lang.Object</A>
<IMG SRC="../../resources/inherit.gif" ALT="extended by"><A HREF="../../java/security/Permission.html" title="class in java.security">java.security.Permission</A>
<IMG SRC="../../resources/inherit.gif" ALT="extended by"><A HREF="../../java/security/BasicPermission.html" title="class in java.security">java.security.BasicPermission</A>
<IMG SRC="../../resources/inherit.gif" ALT="extended by"><B>java.net.NetPermission</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../java/security/Guard.html" title="interface in java.security">Guard</A>, <A HREF="../../java/io/Serializable.html" title="interface in java.io">Serializable</A></DD>
</DL>
<HR>
<DL>
<DT>public final class <B>NetPermission</B><DT>extends <A HREF="../../java/security/BasicPermission.html" title="class in java.security">BasicPermission</A></DL>
<P>
This class is for various network permissions.
A NetPermission contains a name (also referred to as a "target name") but
no actions list; you either have the named permission
or you don't.
该类用于各种网络许可。一个NetPermission包括一个名称(也称为目标名称),但没有行为列表,你可以有命名的许可,也可以没有。
<P>
The target name is the name of the network permission (see below). The naming
convention follows the hierarchical property naming convention.
Also, an asterisk
may appear at the end of the name, following a ".", or by itself, to
signify a wildcard match. For example: "foo.*" or "*" is valid,
"*foo" or "a*b" is not valid.
目标名称即网络许可名称(查看下面部分)。命名的约定遵循分级属性命名约定。同样,星号可以出现在名称的末尾。
例如,“foo.*”或“*”是有效的,“*foo”和“a*b”是无效的。
<P>
The following table lists all the possible NetPermission target names,
and for each provides a description of what the permission allows
and a discussion of the risks of granting code the permission.
下面的表格列出了所有可能的NetPermission目标名称,每一个都给出了许可允许的描述和给代码授权的风险的讨论。
<P>
<table border=1 cellpadding=5 summary="Permission target name, what the permission allows, and associated risks">
<tr>
<th>Permission Target Name</th>
<th>What the Permission Allows</th>
<th>Risks of Allowing this Permission</th>
</tr>
<tr>
<td>setDefaultAuthenticator</td>
<td>The ability to set the
way authentication information is retrieved when
a proxy or HTTP server asks for authentication
当一个代理服务器或HTTP服务器要求身份验证时,得到设置路径身份认证信息的能力</td>
<td>Malicious
code can set an authenticator that monitors and steals user
authentication input as it retrieves the input from the user.
恶意代码能够设置一个身份认证来监听和窃取用户作为输入的用户身份认证信息。</td>
</tr>
<tr>
<td>requestPasswordAuthentication</td>
<td>The ability
to ask the authenticator registered with the system for
a password
要求认证者提供口令在系统中注册的能力</td>
<td>Malicious code may steal this password.
恶意代码可以窃取口令。</td>
</tr>
<tr>
<td>specifyStreamHandler</td>
<td>The ability
to specify a stream handler when constructing a URL
当构造一个URL时指定一个流句柄的能力</td>
<td>Malicious code may create a URL with resources that it would
normally not have access to (like file:/foo/fum/), specifying a
stream handler that gets the actual bytes from someplace it does
have access to. Thus it might be able to trick the system into
creating a ProtectionDomain/CodeSource for a class even though
that class really didn't come from that location.
恶意代码可以创建一个URL,其表示资源是不可访问的,其表示一个可以从可访问处得到的数据的流句柄。这样它可以欺骗系统创建一个类
ProtectionDomain/CodeSource,尽管类并不是实际来自此处。
</td>
</tr>
</table>
<P>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../java/security/BasicPermission.html" title="class in java.security"><CODE>BasicPermission</CODE></A>,
<A HREF="../../java/security/Permission.html" title="class in java.security"><CODE>Permission</CODE></A>,
<A HREF="../../java/security/Permissions.html" title="class in java.security"><CODE>Permissions</CODE></A>,
<A HREF="../../java/security/PermissionCollection.html" title="class in java.security"><CODE>PermissionCollection</CODE></A>,
<A HREF="../../java/lang/SecurityManager.html" title="class in java.lang"><CODE>SecurityManager</CODE></A>,
<A HREF="../../serialized-form.html#java.net.NetPermission">Serialized Form</A></DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../java/net/NetPermission.html#NetPermission(java.lang.String)">NetPermission</A></B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A> name)</CODE>
<BR>
Creates a new NetPermission with the specified name.
创建一个指定名称的NetPermission。</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../java/net/NetPermission.html#NetPermission(java.lang.String, java.lang.String)">NetPermission</A></B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A> name,
<A HREF="../../java/lang/String.html" title="class in java.lang">String</A> actions)</CODE>
<BR>
Creates a new NetPermission object with the specified name.
创建一个指定名称的NetPermission。</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="methods_inherited_from_class_java.security.BasicPermission"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.security.<A HREF="../../java/security/BasicPermission.html" title="class in java.security">BasicPermission</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../java/security/BasicPermission.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/security/BasicPermission.html#getActions()">getActions</A>, <A HREF="../../java/security/BasicPermission.html#hashCode()">hashCode</A>, <A HREF="../../java/security/BasicPermission.html#implies(java.security.Permission)">implies</A>, <A HREF="../../java/security/BasicPermission.html#newPermissionCollection()">newPermissionCollection</A></CODE></TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.security.Permission"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.security.<A HREF="../../java/security/Permission.html" title="class in java.security">Permission</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../java/security/Permission.html#checkGuard(java.lang.Object)">checkGuard</A>, <A HREF="../../java/security/Permission.html#getName()">getName</A>, <A HREF="../../java/security/Permission.html#toString()">toString</A></CODE></TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="NetPermission(java.lang.String)"><!-- --></A><H3>
NetPermission</H3>
<PRE>
public <B>NetPermission</B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A> name)</PRE>
<DL>
<DD>Creates a new NetPermission with the specified name.
The name is the symbolic name of the NetPermission, such as
"setDefaultAuthenticator", etc. An asterisk
may appear at the end of the name, following a ".", or by itself, to
signify a wildcard match.
创建一个指定名称的NetPermission。name是一个NetPermission的符号名称,例如“setDefaultAuthenticator”。
在名称末尾可以跟有星号,还可以跟有一个“.”表示通配符匹配。
<P>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the NetPermission. NetPermission的名称。</DL>
<HR>
<A NAME="NetPermission(java.lang.String, java.lang.String)"><!-- --></A><H3>
NetPermission</H3>
<PRE>
public <B>NetPermission</B>(<A HREF="../../java/lang/String.html" title="class in java.lang">String</A> name,
<A HREF="../../java/lang/String.html" title="class in java.lang">String</A> actions)</PRE>
<DL>
<DD>Creates a new NetPermission object with the specified name.
The name is the symbolic name of the NetPermission, and the
actions String is currently unused and should be null.
创建一个指定名称的NetPermission。name是一个NetPermission的符号名称,且行动字符串目前没有,而且应为null。
<P>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the NetPermission. NetPermission的名称。<DD><CODE>actions</CODE> - should be null. 应为null。</DL>
<!-- ============ METHOD DETAIL ========== -->
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/NetPermission.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.4.2</b></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../java/net/MulticastSocket.html" title="class in java.net"><B>PREV CLASS</B></A>
<A HREF="../../java/net/NetworkInterface.html" title="class in java.net"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="NetPermission.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#methods_inherited_from_class_java.security.BasicPermission">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | METHOD</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
<font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="../../../relnotes/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../../../relnotes/license.html">license terms</a>. Also see the <a href="http://java.sun.com/docs/redist.html">documentation redistribution policy</a>.</font>
</BODY>
</HTML>