Self Signed Applet Can it access Local File Systems

前端 未结 2 1766
星月不相逢
星月不相逢 2021-01-16 03:59

Hi I have created a Self Signed Applet , but not able to access local files system .What have i to do ?

2条回答
  •  Happy的楠姐
    2021-01-16 04:20

    The below code is use to Add a Bouncy Castle Jar, the same way you can use it for accessing the file. AccessController java api is used.

    AccessController.doPrivileged(new PrivilegedAction() {          
      public Object run() {
        try{
          Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());      // Here you can write the code for File Accesss
        }catch (Exception e) {
          return "";
        }
        return "";
      }
    }); 
    

提交回复
热议问题