private void getFileProperties ( String fileName ) { fileProperties . clear ( ) ; if ( ! StringUtils . equals ( filePath , fileName ) ) { if ( log . isInfoEnabled ( ) ) { log . info ( "setting the file properties path to :'" + fileName + "'" ) ; } filePath = fileName ; if ( filePath != null ) { fildes = new File ( filePath ) ; } else { fildes = null ; } } else if ( fildes == null ) { if ( filePath != null ) { fildes = new File ( filePath ) ; } else { log . warn ( "The file properties path can't be null." ) ; return ; } } if ( ! fildes . canRead ( ) ) { log . warn ( "The file properties path :'" + filePath + "' can't be readed" ) ; return ; } try { InputStream in = new FileInputStream ( fildes ) ; fileProperties . load ( in ) ; in . close ( ) ; lastModified = fildes . lastModified ( ) ; if ( log . isInfoEnabled ( ) ) { log . info ( "The properties has been actualized from file:'" + fildes . getAbsolutePath ( ) + "'" ) ; } // notifico a los listener que las propiedades han podido cambiar notifyPropertiesChangedListers ( lastModified ) ; } catch ( IOException e ) { log . warn ( "The file:'" + fildes . getName ( ) + "' can't be read." , e ) ; } }
Reads the file and store the new readed properties .