java - File.exists() security exception -
i'm trying write applet website needs access system on lan, using network path (\\thebox\dir\subdir). i'm checking if directory exists before using it:
try { file thedir = new file(filepath); if (!thedir.exists()) thedir.mkdir(); } catch(exception e) { joptionpane.showmessagedialog(null, e.getcause()+"\n\n"+e.getlocalizedmessage()); }
this catches exception java.io.filepermission. .jar file signed self certificate. here's catch- if run inside of void init() works fine, when name void myfunction() error shows. need name other init doesn't run on page load , can called javascript.
edit: workaround i'm going switch using init(), not load applet until button clicked. while i'd prefer more proper way can't fortunate.
Comments
Post a Comment