提交 364b7d6f 编写于 作者: K kizune

7143768: [macosx] Unexpected NullPointerException and java.io.IOException during DnD

Reviewed-by: alexp
上级 62792077
......@@ -273,8 +273,31 @@ public class CDataTransferer extends DataTransferer {
@Override
protected ByteArrayOutputStream convertFileListToBytes(ArrayList<String> fileList) throws IOException {
// TODO Auto-generated method stub
return null;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
for (int i = 0; i < fileList.size(); i++)
{
byte[] bytes = fileList.get(i).getBytes();
bos.write(bytes, 0, bytes.length);
bos.write(0);
}
return bos;
}
@Override
protected boolean isURIListFormat(long format) {
String nat = getNativeForFormat(format);
if (nat == null) {
return false;
}
try {
DataFlavor df = new DataFlavor(nat);
if (df.getPrimaryType().equals("text") && df.getSubType().equals("uri-list")) {
return true;
}
} catch (Exception e) {
// Not a MIME format.
}
return false;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册