Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8120682

Can't save file using FileSaveService when running a javafx 2.2 applet on Mac OS

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 7u6
    • Fix Version/s: 7u6
    • Component/s: deploy
    • Environment:

      Java Plug-in 10.6.0.16
      Using JRE version 1.7.0_06-ea-b16 Java HotSpot(TM) 64-Bit Server VM
      Firefox Version 13.0.1 User Agent
      Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1

      Description

      I've attached a sample testcase:

      Run the applet
      Click the button:
      FileSaveService is called, trying to save a file on the local filesystem.
                      try {
                              FileSaveService fileSaveService = (FileSaveService) ServiceManager.lookup("javax.jnlp.FileSaveService");
                              ByteArrayOutputStream os = new ByteArrayOutputStream();
                              os.write(10);
                              InputStream imageInputStream = new ByteArrayInputStream(os.toByteArray());
                              String[] extenstions = {"png"};
                              fileSaveService.saveFileDialog(null, extenstions, imageInputStream, "name.png");
                      } catch(Exception e) {
                          logger.log(Level.WARNING, e.toString(), e);
                      }

      RESULT:
      A security dialog is shown requesting for a filesytem access -> User clicks 'OK" -> JVM and browser hang and the applet freezes, no FileChooser is shown

      The same code works under Windows

        Attachments

          Activity

            People

            • Assignee:
              dcherepanov Dmitry Cherepanov
              Reporter:
              kiriljfx Kiril (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: