Copy from com.den_4.inotify-java, origin auther Nick Bargnesi