The checkRead method of the StandardSecurityManager Class contains the following signatures:
checkRead(String file)
checkRead(URL url)
checkRead(String file, Object context)
checkRead(FileDescriptor fd)
Determines whether the specified file can be read by the classes active within the current execution context.
public void checkRead(String file);
file | The file for which permission to be read by active classes is being checked. |
The check succeeds if all the classes found on the call stack possess FileIOPermissions and those permissions allow read access to the specified file. This method overrides the java.lang.SecurityManager.checkRead(String) method.
SecurityException if the security check fails.
Determines whether the specified URL can be read by the code in the current execution context.
public static void checkRead(URL url);
url | The URL for which permission to read is being checked. |
If the specified URL is a file:// URL, this method performs a checkRead(String file) to determine if the file specified by the URL can be read. Otherwise, this method performs a checkConnect(url.getHost(),url.getPort()) to determine if the host/port can be connected to.
SecurityException if the security check fails.
Determines whether the specified file and the specified context object can be read by the classes within the current execution context. This method overrides the java.lang.SecurityManager.checkRead method.
public void checkRead(String file, Object context);
Note The context object must be a URL object.
file | The system-dependent file name. |
context | The URL to be checked in addition to the file. |
SecurityException if the file is not found.
Determines whether classes within the current execution context, based on the call stack of the current thread, can use the specified FileDescriptor object to read from the file it is associated with.
public void checkRead(FileDescriptor fd);
fd | The file descriptor associated with the file from which permission to read is being checked. |
The check succeeds only if all the classes found on the call stack are fully trusted system classes. This method overrides the java.lang.SecurityManager.checkRead(FileDescriptor) method.
SecurityException if the security check fails.