}
private Object getURL(DataFlavor f)
throws IOException, UnsupportedFlavorException {
if (!data.isNativeFormatAvailable(DataProvider.FORMAT_URL)) {
throw new UnsupportedFlavorException(f);
}
String str = data.getURL();
if (str == null) {
// awt.4F=Data is not available
throw new IOException(Messages.getString("awt.4F")); //$NON-NLS-1$
}
URL url = new URL(str);
if (f.getRepresentationClass().isAssignableFrom(URL.class)) {
return url;
}
if (f.isFlavorTextType()) {
return getTextRepresentation(url.toString(), f);
}
throw new UnsupportedFlavorException(f);
}