|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.clients.dndMicroApplet.FileOperation
Privileged file operation class for use by this package (only)
For security reasons all operations will fail if the file is not actually a subclass of java.io.File.
The Sun JDK on Windows does not subclass java.io.File for its File instances. It is unclear if any other JVM does, but since there are public constructors it is highly doubtful that any JVM does such subclassing. [If one does we can workaround it by creating java.io.File objects from the File sub-class objects that are passed in...]
Field Summary | |
private static int |
CREATE_TEMP_FILE
Operation code to create a temporary file. |
(package private) static int |
DELETE_FILE_OP
Operation code to delete the given file. |
private Exception |
exception
Exception thrown during file operation (during run()) |
private File |
file
Primary file to be operated upon |
(package private) static int |
GET_OUTPUT_STREAM_OP
Operation code to get an output stream from/for the given file. |
(package private) static int |
IS_DIRECTORY_OP
Operation code for isDirectory() operation. |
private int |
opCode
Type of file operation to be done |
private String |
prefix
Prefix for createTempFile() |
private String |
suffix
Suffix for createTempFile() |
private static Set |
trackedFiles
Files being tracked |
Constructor Summary | |
(package private) |
FileOperation(File file,
int opCode)
Construct file operation |
(package private) |
FileOperation(String prefix,
String suffix)
Construct createTempFile()-like file operation. |
Method Summary | |
private File |
createTempFile()
Return file named exactly as per prefix and suffix if it does not exist, else generate a temp file whose name is based on prefix and suffix. |
(package private) Exception |
getException()
Retrieve exception thrown by operation |
private static boolean |
isTracking(File file)
Determine whether the given file is being tracked - and thus whether sensitive operations are allowed on this file (e.g. |
Object |
run()
Main (required) privileged engine method (called by AccessController, not directly by caller code). |
private static void |
startTracking(File file)
Add file to list of files being tracked by this class - and thus allow sensitive operations on this file (e.g. |
(package private) static void |
stopTracking(File file)
Stop tracking the given file - after which point it cannot be written to or deleted by this class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final int CREATE_TEMP_FILE
static final int GET_OUTPUT_STREAM_OP
static final int DELETE_FILE_OP
static final int IS_DIRECTORY_OP
private int opCode
private File file
private String prefix
private String suffix
private Exception exception
private static Set trackedFiles
Constructor Detail |
FileOperation(File file, int opCode)
FileOperation(String prefix, String suffix)
Method Detail |
Exception getException()
static void stopTracking(File file)
private static void startTracking(File file)
private static boolean isTracking(File file)
public Object run()
run
in interface PrivilegedAction
private File createTempFile() throws IOException
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |