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

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -