All the best ideas from the thread in a ZIP file
There is no need to repeat the FileSize implementation. As already wrote @pawel, you can use FileUtil.FileSize.
In general, I would also recommend using an additional check via FileExists to exclude names like *.txt, which the current implementation allows.