签署导致问题的罐子
我在applet中有以下代码,基本上将一些数据写入作为参数传递给writeFile方法的文件()
public class appletToWrite extends Applet{
public int writeFile(String asPath, String asData, int aiOverwrite)
{
int j = JOptionPane.showConfirmDialog(null,asPath+ "testing gng on", "data mil gaya!!!", 0);
try {
File localFile = new File(asPath);
if (localFile.exists()) {
if(aiOverwrite==1){
localFile.delete();
j =JOptionPane.showConfirmDialog(null,"overwrite = 1", "data mil gaya!!!", 0);
}
else{
j = JOptionPane.showConfirmDialog(null, "overwrite = 0", "data mil gaya!!!", 0);
return 0;
}
}
j = JOptionPane.showConfirmDialog(null, "niche aa gaye", "data mil gaya!!!", 0);
localFile.createNewFile();
BufferedWriter localBufferedWriter = new BufferedWriter(new FileWriter(localFile, true));
String str1;
localBufferedWriter.write(asData);
localBufferedWriter.close();
return 1;
}
catch (Exception localException) {
j = JOptionPane.showConfirmDialog(null, "catch mein aa gaya "+localException.getMessage(), "data nahi gaya!!!", 0);
localException.printStackTrace();
return 0;
}
}
}
我使用以下命令自我签署了jar
javac appletToWrite.java
jar cvf AppletClass.jar *.class
keytool -genkey -validity 3650 -keystore pKeyStore -alias formBuilder
keytool -selfcert -keystore pKeyStore -alias formBuilder -validity 3650
jarsigner -keystore pKeyStore AppletClass.jar formBuilder
但仍然没有得到在本地机器上写文件的所有权限我得到文件权限否认任何想法为什么?
没有找到相关结果
已邀请:
3 个回复
茶鬼失形
呕蹿尉
拈吉勉犬姆