4

I'm using a java applet to select a gml file and validate it with a xsd scheme.

String selectedPath;
FileDialog selectFileDialog;

private String ShowFileDialog(String title, String extension) {
    selectFileDialog.setFile(extension);
    selectFileDialog.setTitle(title);
    selectFileDialog.setVisible(true);

    if (selectFileDialog.getFile() == null)
        return null;

    return selectFileDialog.getDirectory() + selectFileDialog.getFile();
}

public void SelectFile(){
    selectedPath = ShowFileDialog("Select file", "*.gml");
}

public void ProcessFile(){
    InputStream inputStream = new FileInputStream(new File(selectedPath));
    InputSource inputSource = new InputSource(inputStream);
    //... sending file to sax parser
}

GUI consist of only two java.awt buttons calling these functions.

Manifest.MF file includes

Permissions: all-permissions

I've also signed jar file because of permission issues. So it's working without any doubt.

But the problem is that when i trigger these (public) functions from javascript it throws the exception below

//This functions is working properly, shows FileDialog and selecting file
document.applets[0].SelectFile();

//This function throws exception.
//Instead of clicking this button i can click java gui button and execute function properly
document.applets[0].ProcessFile();

access denied ("java.io.FilePermission" "blablafile.gml" "read")

I'm asking that because i don't want to use java gui elements, i have to trigger these events from pure HTML elements.

Ahmet Kakıcı
  • 6,294
  • 4
  • 37
  • 49

0 Answers0