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

Mac: The Dragboard (DragEvent.getDragboard()) contains invalid files when the dragged file path contains spaces or special characters.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8
    • 7u6
    • javafx
    • JavaFx 2.2 b18

      Product: javafx-2.2.0beta
      Platform: macosx-universal
      Build-Number: 134
      Build-ID: 2012-07-17_17-02-04

      When dragging a file whose path contains spaces or special characters, such as "/Users/danielfuchs/Desktop/tool stuff/Capture d'écran 2012-03-23 à 10.48.52.png", the Dragboard returns an invalid file.

      If I do:

      File file = dragEvent.getDragboard().getFiles().iterator().next();
      System.out.println("File: " + file.getAbsolutePath());
      System.out.println("File exists: " + file.exists());

      I see:

      File: /Users/danielfuchs/Desktop/tool%20stuff/Capture%20d%E2%80%99e%CC%81cran%202012-02-10%20a%CC%80%2011.57.48.png
      File exists: false

      I should be seeing:

      File: /Users/danielfuchs/Desktop/tool stuff/Capture d'écran 2012-03-23 à 10.48.52.png
      File exists: true

      The file in the Dragboard is invalid: I guess there was a conversion from URI to File which went wrong.

            pchelko Petr Pchelko (Inactive)
            dfuchs Daniel Fuchs
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: