}
private Object getURL(DataFlavor f)
throws IOException, UnsupportedFlavorException {
if (!data.isNativeFormatAtailable(DataProvider.FORMAT_URL)) {
throw new UnsupportedFlavorException(f);
}
String str = data.getURL();
if (str == null) {
throw new IOException("Data is not available");
}
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);
}