Microsoft SDK for Java

checkWrite

The checkWrite method of the StandardSecurityManager Class contains the following signatures:

checkWrite(String file)
checkWrite(FileDescriptor fd)

checkWrite(String file)

Determines whether the specified file can be written to by the classes active within the current execution context.

The check succeeds only if all the classes found on the call stack possess FileIOPermissions and if those permissions allow write access to the specified file. This method overrides the java.lang.SecurityManager.checkWrite(String) method.

Syntax

public void checkWrite(String file);

Parameters

file The system-dependent file name.

Exceptions

SecurityException if the security check fails.

checkWrite(FileDescriptor fd)

Determines whether classes within the current execution context, based on the call stack of the current thread, can use the specified FileDescriptor object to write to the file it is associated with.

Syntax

public void checkWrite(FileDescriptor fd);

Parameters

fd The file descriptor that is associated with the file.

Remarks

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.checkWrite(FileDescriptor) method.

Exceptions

SecurityException if the security check fails.

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