How do I use the scratch space area in Internet Explorer?
One thing that IE does offer outside of the privilege model is scratch space. Your applets have access to temporary storage space on the client file system, enabling them to store state across multiple invocations, up to 1 MB of space. Also, the same applet loaded from multiple download sites has access to the same scratch space. Like Netscape's Capabilities API, scratch space works from unsigned applets for debugging. However, to be usable from a web server, the applet must be placed in a signed CAB file.
You must use the Microsoft Virtual Machine for Java, found in Internet Explorer 4.x/5.x to utilize these capabilities. However, you can still compile with the JDK compiler if you include Microsoft's classes.zip file after the JDK's classes.zip in your CLASSPATH. On a Windows NT machine, the file is probably located in C:WinNTJavaClasses.
// Assert permissions PolicyEngine.assertPermission( PermissionID.CLIENTSTORE); // Get ClientStore from ClientStorageManager ClientStore cs = ClientStorageManager.getStore(); // Create new file / overwrite OutputStream os1 = cs.openWritable(filename); // Open writable file in append mode OutputStream os2 = cs.openWritable(filename, true); // Get readable file from cache InputStream is = cs.openReadable(filename);
So, where are the temporary files stored? They can be found in the Local Data directory, under the Java directory. There are protections in place so a temporary file cannot consume all available disk space. The Java directory is also where you will find the javalog.txt file that would contain any messages sent to the equivalent of Netscape's Java Console.
The use of a scratch space from core classes is only available with the Microsoft VM. If you wanted to do this with other runtimes like the Plug-in, you would have to implement this behavior yourself.