if (localTransferable != null) {
return localTransferable.getTransferData(df);
}
if (dropStatus != STATUS_ACCEPT || dropComplete) {
throw new InvalidDnDOperationException("No drop current");
}
Map flavorMap = DataTransferer.getInstance().getFlavorsForFormats
(currentT, DataTransferer.adaptFlavorMap
(currentDT.getFlavorMap()));
lFormat = (Long)flavorMap.get(df);
if (lFormat == null) {
throw new UnsupportedFlavorException(df);
}
if (df.isRepresentationClassRemote() &&
currentDA != DnDConstants.ACTION_LINK) {
throw new InvalidDnDOperationException("only ACTION_LINK is permissable for transfer of java.rmi.Remote objects");
}
final long format = lFormat.longValue();
Object ret = getNativeData(format);
if (ret instanceof byte[]) {
try {
return DataTransferer.getInstance().
translateBytes((byte[])ret, df, format, this);
} catch (IOException e) {
throw new InvalidDnDOperationException(e.getMessage());
}
} else if (ret instanceof InputStream) {
try {
return DataTransferer.getInstance().
translateStream((InputStream)ret, df, format, this);
} catch (IOException e) {
throw new InvalidDnDOperationException(e.getMessage());
}
} else {
throw new IOException("no native data was transfered");
}
}