JDK-6772699 : Drop Location if on Native OS
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u10
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_vista
  • CPU: x86
  • Submitted: 2008-11-18
  • Updated: 2011-02-16
  • Resolved: 2010-11-01
Related Reports
Duplicate :  
When dragging an object onto the native OS, there is no way to get the location of the drop. (E.g. the desktop URI, or the folder URI that the drop was into)

This was an essential feature of my ftp program.  I wanted to drop an object representing a file onto the OS desktop or OS folder and only begin downloading after the drop took place.  The current implementation requires the file to already exist on the client side during the drag operation, which is not acceptable since the file may be huge, and wouldn't be available when the first request for the Transferable data is made by the OS during the drag.

When a drop is made onto the OS, there should be some way to tell what the drop was onto, be it a Folder, the desktop, or something else.  Also, if the drop was onto a folder or desktop, there should be some way to get the URI for this location.
The OS makes a request for the file during the drag process, which as stated above, if it is large, it won't be available.  Using a temp file to pass to the OS during the drag and then getting the location of the temp file afterwords was one of my best ideas as a possible solution for this.  However, the OS simply copies the bits of the temp file and creates its own file which there is no way to get a reference to, so this does not work.

The only workaround I have found for this is to have a representation of the OS file system as part of the Java program, and drop onto this representation.  This is not what I wanted though and in fact, is exactly what I was trying to "not" do. Its just something I had to settle for.  Hopefully this functionally can be added soon so that my program can do what it was intended to do.