I am trying to use the URL.openStream() method on the local filesystem from an
applet, to no avail. Here are the particulars (so far):
java code:
URL url = new URL('file:\\\C:\Users\...\file.txt');
url.openStream();
receives the error "Bad crossdomain.xml: access denied ("java.io.FilePermission" "C:\Users\...\file.txt" "read")"
Here is the pertinent part of my .java.policy file (located in the user home directory):
grant codeBase "file:C:/Users/.../" {
permission java.io.FilePermission "C:\\Users\\...\\file.txt", "read" ;
};
Here is my crossdomain.xml file contents (located in the directory of the .html file containing the Java applet):
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<?xml version="1.0"?>
<cross-domain-policy>
<!-- <site-control permitted-cross-domain-policies="by-content-type"/> -->
<allow-access-from domain="file:C:\\Users\\...\\" secure="true"/>
</cross-domain-policy>
Or possibly should the crossdomain.xml file be in the user home directory?
Slash or back-slash, too many possibilities. Please help me straighten this out. Thanks in advance.