Friday, February 24, 2017

welcome back to war! again after an argument for an authenticate input (get my point will u..because i deserve it :) check it out :"I have a method within an unsigned applet which uses the following code to open a file.URL searchDataURL = new URL(getDocumentBase(), "data/filename.txt");InputStream inputStream = searchDataURL.openStream();This method is successful when called within the applet's init() method, but since version 1.4.2_01 of the JRE/Plug-in an exception is thrown when the same type of code is called from JavaScript using JavaScript to Java communication. The exception is:
"java.security.AccessControlException: access denied(java.io.FilePermission FILENAME read)"
More background information:
I have a cd-rom containing html pages which use JavaScript to dynamically generate html content. The JavaScript calls an unsigned Java applet to obtain a list of transactions which are displayed to the user. The applet is used as a search engine and provides no visual user interface (its size is set to a single pixel). When the applet is initialized it uses the openStream() method of a URL object pointing to a text file containing the information to search. There is no problem in this step since the file is located in a directory under the DocumentBase. The applet is able to read the transaction information and search the data. After the transactions are displayed the system allows the user to select a transaction to obtain more information and view any supporting images for the transaction. To determine if an image file is available, I have created a public method in my applet called doesFileExist which returns a boolean value. In the past this method has been able to create a URL object for the image file and use the openStream() method to determine if the file is present on the cd-rom. After upgrading to the Sun Java Plug-in version 1.4.2_01 this method is throwing an AccessControlException when attempting to read the image file"

No comments: