play2-source-watchers/play2-source-watcher-jdk7/src/main/java/com/google/code/play2/watcher/jdk7/JDK7FileWatchService.java
@Override
    public FileWatcher watch( List<File> filesToWatch, FileWatchCallback watchCallback )
        throws FileWatchException
    {
        List<File> dirsToWatch = new ArrayList<File>( filesToWatch.size() );
        for ( File file: filesToWatch )
        {
            if ( file.exists() )
            {
                if ( file.isDirectory() )
                {
                    dirsToWatch.add( file );
                }
                else
                {
                    if ( log != null && log.isWarnEnabled() )
                    {
                        log.warn( String.format( "[jdk7] \"%s\" is not a directory, will not be watched.",
                                                    file.getAbsolutePath() ) );
                    }
                }
            }
            else
            {
                if ( log != null && log.isWarnEnabled() )
                {
                    log.warn( String.format( "[jdk7] \"%s\" does not exist, will not be watched.",
                                                file.getAbsolutePath() ) );
                }
            }
        }

        try
        {
            JDK7FileWatcher result = new JDK7FileWatcher( log, dirsToWatch, watchCallback );

            Thread thread = new Thread( result, "jdk7-play-watch-service" );
            thread.setDaemon( true );
            thread.start();

            return result;
        }
        catch ( IOException e )
        {
            throw new FileWatchException( "JDK7FileWatcher initialization failed", e );
        }
    }
@Override
    public FileWatcher watch( List<File> filesToWatch, FileWatchCallback watchCallback )
        throws FileWatchException
    {
        List<File> dirsToWatch = new ArrayList<File>( filesToWatch.size() );
        for ( File file: filesToWatch )
        {
            if ( file.exists() )
            {
                if ( file.isDirectory() )
                {
                    dirsToWatch.add( file );
                }
                else
                {
                    if ( log != null && log.isWarnEnabled() )
                    {
                        log.warn( String.format( "[jdk7] \"%s\" is not a directory, will not be watched.",
                                                    file.getAbsolutePath() ) );
                    }
                }
            }
            else
            {
                if ( log != null && log.isWarnEnabled() )
                {
                    log.warn( String.format( "[jdk7] \"%s\" does not exist, will not be watched.",
                                                file.getAbsolutePath() ) );
                }
            }
        }

        try
        {
            JDK7FileWatcher result = new JDK7FileWatcher( log, dirsToWatch, watchCallback );

            Thread thread = new Thread( result, "jdk7-play-watch-service" );
            thread.setDaemon( true );
            thread.start();

            return result;
        }
        catch ( IOException e )
        {
            throw new FileWatchException( "JDK7FileWatcher initialization failed", e );
        }
    }
@ Override public FileWatcher watch ( List < File > filesToWatch , FileWatchCallback watchCallback ) throws FileWatchException { List < File > dirsToWatch = new ArrayList < File > ( filesToWatch . size ( ) ) ; for ( File file : filesToWatch ) { if ( file . exists ( ) ) { if ( file . isDirectory ( ) ) { dirsToWatch . add ( file ) ; } else { if ( log != null && log . isWarnEnabled ( ) ) { log . warn ( String . format ( "[jdk7] \"%s\" is not a directory, will not be watched." , file . getAbsolutePath ( ) ) ) ; } } } else { if ( log != null && log . isWarnEnabled ( ) ) { log . warn ( String . format ( "[jdk7] \"%s\" does not exist, will not be watched." , file . getAbsolutePath ( ) ) ) ; } } } try { JDK7FileWatcher result = new JDK7FileWatcher ( log , dirsToWatch , watchCallback ) ; Thread thread = new Thread ( result , "jdk7-play-watch-service" ) ; thread . setDaemon ( true ) ; thread . start ( ) ; return result ; } catch ( IOException e ) { throw new FileWatchException ( "JDK7FileWatcher initialization failed" , e ) ; } }
{@inheritDoc}
{