Microsoft SDK for Java

PropertyAccessRequest Class

The PropertyAccessRequest Class of the com.ms.security.permissions package represents a request to access the system properties.

public class PropertyAccessRequest implements ISecurityRequest
{
  // Fields
  public static final int ALL;
  public static final int INDIVIDUAL;

  // Constructors
  public PropertyAccessRequest(int type,String param);
  public PropertyAccessRequest();
  public PropertyAccessRequest(String prop);

  // Methods
  public PermissionID getPermissionID();
  public String toString();
}

Use an instance of this class as the security request object for a parameterized security check involving the system properties permission. The PropertyPermission.check method expects a PropertyAccessRequest object as its parameter.

Example

The following example shows how to use a PropertyAccessRequest object to perform a security check:

... 
// Create a PropertyAccessRequest object that indicates  
// that you want to read the system property called 
// java.class.path.

PropertyAccessRequest sreq = 
   new PropertyAccessRequest("java.class.path");

// Check to see that all of your callers have the 
// rights to read that system property.

PolicyEngine.checkPermission(sreq);  
...

For more information about checking system properties, see the PolicyEngine class and the PropertyPermission class.

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