|
|
|||||||||||||
Class FileIORequestpublic class FileIORequest implements ISecurityRequest { // Fields public static final int DELETE; public static final int READ; public static final int WRITE; // Constructors public FileIORequest (int type, String file); public FileIORequest (int type); // Methods public PermissionID getPermissionID(); public String toString (); } This class represents a request for access to the file system. FileIORequest instances should be used as the security request objects for parameterized security checks involving the file I/O permission. The FileIOPermission.check method expects a FileIORequest object as its parameter. The following example shows how to use a FileIORequest object to perform a security check to determine whether a file called sample.txt can be opened for reading. ... // Create a FileIORequest object that indicates that you want to // read the file called "c:\\sample.txt". FileIORequest sreq = new FileIORequest(FileIORequest.READ,"c:\\sample.txt"); // Check to see that all of your callers // have the rights to read that file. PolicyEngine.checkPermission(sreq); ... For more information about checking file I/O permissions, see the PolicyEngine class and the FileIOPermission class. ConstructorsFileIORequestpublic FileIORequest (int type, String file); FileIORequestpublic FileIORequest (int type); MethodsgetPermissionIDpublic PermissionID getPermissionID(); toStringpublic String toString (); Fields
|
© 1998 Microsoft Corporation. All rights reserved. Terms of use. |