Microsoft SDK for Java

addPattern

The addPattern method of the NetIOPermission Class contains the following signatures:

addPattern(int flags, String spec)
addPattern(int flags, String spec, IntRanges ports)

addPattern(int flags, String spec)

Parses a pattern and adds it to the permission as an IP or host rule, as appropriate.

Syntax

public void addPattern(int flags, String spec);

Parameters

flags The access flags, which consist of two separate flags combined with a logical OR operator (|). The first flag should be BIND, CONNECT, MULTICAST, or ALL_API_FLAGS to specify the connection type. The second flag should be either ALLOW or DENY to indicate whether the rule being added indicates inclusion or exclusion. For convenience, instead of using the logical OR operator with the two flags, you can use one of the combination flags: ALLOWALL, DENYALL, ALLOWCONNECT, DENYCONNECT, ALLOWBIND, DENYBIND, ALLOWMULTICAST, or DENYMULTICAST.
spec The textual IP/host specification.

addPattern(int flags, String spec, IntRanges ports)

Parses a pattern and adds it to the permission as an IP or host rule, as appropriate, with the specified port rules.

Syntax

public void addPattern(int flags, String spec, IntRanges ports);

Parameters

flags The access flags, which consist of two separate flags combined with a logical OR operator (|). The first flag should be either BIND or CONNECT to specify the connection type. The second flag should be either ALLOW or DENY to indicate whether the rule being added indicates inclusion or exclusion. For convenience, instead of using the logical OR operator with the two flags, you can use one of the combination flags: ALLOWALL, DENYALL, ALLOWCONNECT, DENYCONNECT, ALLOWBIND, DENYBIND.
spec The textual IP/host specification.
ports The ports that apply to the hosts or IPs.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.