AjaxFileDropBehavior 利用をラムダで書くようにする

先日の Python 画像加工結果→Javaで受信→WebPage表示 - Oboe吹きプログラマの黙示録
僅かだがスマートに記述するために、Throwable で Serializable な BiConsumer を用意して
AjaxFileDropBehavior の継承を用意しました。
Throwable で Serializable な BiConsumer
yipuran-wicketcustom/SerialThrowableBiConsumer.java at master · yipuran/yipuran-wicketcustom · GitHub

AjaxFileDropBehavior の継承
https://github.com/yipuran/yipuran-wicketcustom/blob/master/src/main/java/org/yipuran/wicketcustom/ajax/AjaxFileDropUpdateBehavior.java

これにより、先日のドラッグ&ドロップによるファイルアップロードは、
ドロップしたファイルのサイズ(width, height)取得とリサイズのメソッドを外に出して
画像だけに制限して以下のように記述できます。

image.add(AjaxFileDropUpdateBehavior.of(
fu->Pattern.compile("^image/(jpeg|png|gif)$").matcher(fu.getContentType().toLowerCase()).matches()
, (t, flist)->{
   FileUpload fu = flist.get(0);
   imageName = fu.getClientFileName();
   try(InputStream in = fu.getInputStream();ByteArrayOutputStream out = new ByteArrayOutputStream()){
      in.transferTo(out);
      // 画像サイズ
      Map<String, Integer> smap = getScale(fu);
      Map<String, Integer> rmap = resize(smap, 420);
      imageWidth = smap.get("width").toString();
      imageHeight = smap.get("height").toString();
      
      // TODO 処理...

   }
}, (t, x)->{
   t.appendJavaScript("alert('Error')");
   logger.warn(x.getMessage(), x);
}));
queue(image);