public static String getDefaultWatchServiceId ( ) { String result = "polling" ; String osName = System . getProperty ( "os.name" ) ; if ( osName != null ) { osName = osName . toLowerCase ( Locale . ENGLISH ) ; if ( osName . contains ( "windows" ) || osName . contains ( "linux" ) ) { result = isAtLeastJava7 ( ) ? "jdk7" : "jnotify" ; } else if ( osName . contains ( "mac" ) ) { result = "jnotify" ; } } return result ; }
Returns default watch service identifier based on operating system .