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

Can't select a file through symlink using a JFileChooser

XMLWordPrintable

    • b86
    • generic, x86, sparc, itanium
    • generic, linux, solaris_8

      JFileChooser impl uses getCanonicalFile() internally during FS browsing.
      If the user has a file and a symlink, e.g.:
      /home/user/data/file.txt
      /data -> /home/user/data,
      and wants to select the file through that symlink, he can't browse there,
      because the JFileChooser will convert /data to /home/user/data
      There are legitimate uses for the need to get the user selected symlink
      instead of the canonical path to the target, example:
      The selected path may be persisted between app sessions and the user may need
      to change the target of the symlink (different version of a library, some VCS uses symlinks for paths to latest valid bits, ...)



      File.getCanonical* calls are not apparently made from JFileChooser itself, nor from FileSystemView, but are made from various FileChooserUI subclasses.
      ###@###.### 2004-07-21

            loneid Leonid Popov (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: