Applet Security Restrictions and Limited Access to Files

JConcorder Home

Cette page en fran├žais


An applet is a browser-based Java application. That is, it runs within a web browser such as the one you are using to consult this very page. Given the technical risks of connection to the internet, and in order to protect your computer from unauthorized intrusion, applets are severely restricted in their ability to access the file system of the computer on which the browser is running. In fact, by default an applet can neither read from nor write to any file on your computer. This restriction applies of course to the applet-prototype of JConcorder.

Despite this restriction, you can nevertheless use the JConcorder applet to get a good idea of its functionality and even to generate easily a concordance from your own text document. Below are three approaches you can take, in order of complexity. If you are not sure how to proceed, just do number 1 or number 2, each of which is very simple.

1. Explore the demo document.

The demo document is opened automatically when the applet loads. (If you happen to have closed it, you can reopen it by choosing "Demo" from the "Miscellany" menu.) You can generate a catalogue of words from this document and experiment with other features of JConcorder without interacting at all with your local file system. Read the demo document itself for further information.

2. Open a new document and insert your own text into it.

Select "New" from the "File" menu. A new empty text document will appear. You can paste (or type) any text you want into this document. For example, you can open one of your own text files in a text editor (outside of JConcorder), do "Select All" and then "Copy", and finally paste the result into the new empty document you created in JConcorder. This process allows you use your own text to experiment with the features of JConcorder, but without granting JConcorder any access to your file system.

3. Add a policy file to your user directory in order to provide limited file access to JConcorder.

This will allow JConcorder to read files from your local disk and to write them into a particular directory which you specify. To do this, you must first create a policy file in your user directory. (Under Windows XP, the user directory is usually something like C:\Documents and Settings\username. On Macintosh, Linux and Unix systems, it is located at ~/username.) Create a file called .java.policy containing the following lines:

grant codeBase "http://www.concorder.ca/-" {
  permission java.io.FilePermission "<<ALL FILES>>", "read";
  permission java.io.FilePermission "/tmp/-", "write";
  permission java.util.PropertyPermission "user.dir", "read";
};

and place it in your user directory. Then close your brower, reopen it and return to this web site, specifically to the page where the applet runs. JConcorder will then be able to read files from anywhere on your file system and write files only inside the folder /tmp and its subfolders. (Use the "Open..." and "Save..." commands in JConcorder's "File" menu to take advantage of this file access.)

Please be aware that this approach opens your local file system to access by the applet. It is thus recommended that you remove the .java.policy file from your user directory when you are not using JConcorder.

If you find all this to be just too complicated, then use approach 1 or 2 above. Or simply wait for the full application version.


XHTML CSS