public Map<String, Object> readIfUpdated() throws IOException
    {
        long nowTime = getNowTime();
        if ((nowTime - this.lastWatchTime) <= this.watchInterval)
        {
            return null;
        }

        this.lastWatchTime = nowTime;

        if (this.targetFile.exists() == false)
        {
            return null;
        }

        long targetFileModified = this.targetFile.lastModified();
        if (this.lastModifytime >= targetFileModified)
        {
            return null;
        }

        this.lastModifytime = targetFileModified;

        return StormConfigGenerator.readYaml(this.targetFile);
    }
public Map < String , Object > readIfUpdated ( ) throws IOException { long nowTime = getNowTime ( ) ; if ( ( nowTime - this . lastWatchTime ) <= this . watchInterval ) { return null ; } this . lastWatchTime = nowTime ; if ( this . targetFile . exists ( ) == false ) { return null ; } long targetFileModified = this . targetFile . lastModified ( ) ; if ( this . lastModifytime >= targetFileModified ) { return null ; } this . lastModifytime = targetFileModified ; return StormConfigGenerator . readYaml ( this . targetFile ) ; }
Read config file if fulfill following conditions.<br>
<ol>
<li>{@literal (nowtime - lastWatchTime) > watchInterval}</li>
<li>{@literal (target file's lastmodifytime) > lastModifytime}</li>
</ol>

@return config read result if updated.
@throws IOException If read failed.