Gtk: Line break when get a list of Files from DragEvent

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 8
    • Affects Version/s: 7u6
    • Component/s: javafx
    • Environment:

      Testsystem Debain 7 (Linux lunachod 3.2.0-2-686-pae), Java Version 1.7 u6


      DnD event on a node with a list of Files. The resulting list of files are all corrupt, because the URL contains a line break. If you try to use the File object you will always get a FileNotFoundExceptipon. The workaround file.toString().replaceAll("(\\r|\\n)", "") solves this issue

      Example:

      public void handle(final DragEvent event) {
      final Dragboard db = event.getDragboard();
      String url = null;
      if (db.hasFiles()) {
      final List<File> myFiles = db.getFiles();
                                             // if you put 3 files from Nautilus, each File in this list is like "/home/xyz/myFile.txt\n"
                                     }
                             }

            Assignee:
            Alexander Zvegintsev
            Reporter:
            Andy Moncsek (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: