if (dropHandler == null || !currentlyValid) {
return true;
}
try {
VTransferable transferable = vaadinDragEvent.getTransferable();
JsArrayString types = event.getTypes();
for (int i = 0; i < types.length(); i++) {
String type = types.get(i);
if (isAcceptedType(type)) {
String data = event.getDataAsText(type);
if (data != null) {
transferable.setData(type, data);
}
}
}
int fileCount = event.getFileCount();
if (fileCount > 0) {
transferable.setData("filecount", fileCount);
for (int i = 0; i < fileCount; i++) {
final int fileId = filecounter++;
final VHtml5File file = event.getFile(i);
VConsole.log("Preparing to upload file " + file.getName()
+ " with id " + fileId);
transferable.setData("fi" + i, "" + fileId);
transferable.setData("fn" + i, file.getName());
transferable.setData("ft" + i, file.getType());
transferable.setData("fs" + i, file.getSize());
queueFilePost(fileId, file);
}
}