OSX failing to get a url for image even though it is a supported dataflavour for the transferable
Scott Palmer
swpalmer at gmail.com
Mon Sep 22 13:03:03 UTC 2014
The XML has an array of two strings. Are you sure you aren't getting
the error from the second blank string?
Scott
On Mon, Sep 22, 2014 at 7:10 AM, Paul Taylor <paul_t100 at fastmail.fm> wrote:
> Customer reporting this error when trying to copy and paste an image from
> amazon, although we check the transferable object support a particular
> dataflavor, it fails when try and use that data flavour to get a url. Ive
> not seen this error before and recently moved to Java 1.8.0_20 so I'm
> assuming the issues lies with Java 8 ?
>
> java.net.MalformedURLException: no protocol: <?xml version="1.0"
> encoding="UTF-8"?>
> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
> "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
> <plist version="1.0">
> <array>
> <string>http://ecx.images-amazon.com/images/I/41NTPXC8EHL.jpg</string>
> <string></string>
> </array>
> </plist>
>
> at java.net.URL.<init>(URL.java:586)
> at java.net.URL.<init>(URL.java:483)
> at java.net.URL.<init>(URL.java:432)
> at
> sun.lwawt.macosx.CDataTransferer.translateBytes(CDataTransferer.java:135)
> at
> sun.awt.datatransfer.ClipboardTransferable$DataFactory.getTransferData(ClipboardTransferable.java:71)
> at
> sun.awt.datatransfer.ClipboardTransferable.getTransferData(ClipboardTransferable.java:168)
>
> Code Extract
>
> public static DataFlavor imageUrlFlavor = new
> DataFlavor("application/x-java-url;class=java.net.URL");
> public void getImage(Transferable trans)
>
> if(trans.isDataFlavorSupported(FileDropTarget.imageUrlFlavor))
> {
> imageUrl = (URL)
> trans.getTransferData(FileDropTarget.imageUrlFlavor);
> }
>
>
More information about the macosx-port-dev
mailing list