This discussion is archived
1 Reply Latest reply: Mar 4, 2013 1:09 PM by aksarben RSS

[Applet] jse 1.6.0 -- can not create folders

Hurukan Newbie
Currently Being Moderated
Greetings !!

I'm trying to create a folder using File.mkdirs() method but I have always a write access denial.

if(!devmode)
*     {*
*          WorkingFolders=new File(strCurrentClass.replace(" ","\\ "),Nom+"_"+Prenom);*
*     }*
*     else*
*     {*
*          WorkingFolders=new File("src/cssmbulletins/files/"+strCurrentClass.replace(" ","\\ "),Nom+"_"+Prenom);*
*     }*
*     *
*     FilePermission tmp=new FilePermission(WorkingFolders.getAbsolutePath(), "read,write,execute,delete");*
*     *
*     if(WorkingFolders.canWrite())*
*          WorkingFolders.mkdirs();*
*     else*
*          JOptionPane.showMessageDialog(this, "Failed !!");*

FYI in the java.policy file I got
permission java.io.FilePermission "src/cssmbulletins/-", "read,write,execute,delete";

I can't have a write permission on this folder.
I use this part of code in a Applet that could create simple files (pdf files) without any problem (using PdfReader/PdfWriter).

Any ideas of what I missed ?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points