The FileIOPermission Class of the com.ms.security.permissions package represents a permission that controls the ability to access files. The StandardSecurityManager checks for this permission type when performing the checkRead, checkWrite, and checkDelete operations.
public class FileIOPermission implements IPermission, IEncodablePermission, IAdjustablePermission { // Constructors public FileIOPermission(); // Methods public void addDeleteableFile(String filename, boolean allowed) throws IOException; public void addDeleteableFiles(String pattern, boolean allow); public void addFile(int access, String filename, boolean allowed) throws IOException; public void addFiles(int access, WildcardExpression newspec, boolean allowed); public void addReadableFile(String filename, boolean allowed) throws IOException; public void addReadableFiles(String pattern, boolean allow); public void addWriteableFile(String filename, boolean allowed) throws IOException; public void addWriteableFiles(String pattern, boolean allow); public void adjustPermission(String tag, Object adjustment); public void check(Object param) throws SecurityException; public IPermission combine(IPermission source2); public int compareSet(Object target); public IPermission copy(); public boolean decode(String tag, InputStream data); public boolean encode(String tag, OutputStream out); public boolean getCanReadFromFileURLCodebase(); public WildcardExpression getDeleteableFiles(boolean allowed); public WildcardExpression getFiles(int access, boolean allowed); public WildcardExpression getReadableFiles(boolean allowed); public WildcardExpression getWriteableFiles(boolean allowed); public String mapFormat(String format); public void reset(); public void setCanReadFromFileURLCodebase(boolean flag); public String[] supportedFormats(); public String toString(); }
The permission distinguishes between the following types of file I/O access:
Read-only access to the contents of the file or access to information about the file, such as its length or last modification time.
Write access to the contents of the file or access to change information about the file, such as its name.
The ability to delete the file.
The specific files that the permission instance allows for each of these access types are defined by a pair of include/exclude patterns.
When permissions are checked, the requested file name is expanded to its full form using java.io.File.getCanonicalPath, so the permission objects must contain full path specifications. The addReadableFile, addWriteableFile, and addDeleteableFile methods can be used to convert a single file name to its full form and add it to the permission.
This class implements the IPermission, the IEncodablePermission, and the IAdjustablePermission interfaces.
com.ms.security.permissions.FileIORequest