private User getUserFromFile ( File userFile ) { if ( userFile . isFile ( ) && userFile . canRead ( ) ) { try ( FileInputStream userFileIO = new FileInputStream ( userFile ) ; ) { Properties userProps = new Properties ( ) ; userProps . load ( userFileIO ) ; return new User ( userFile . getName ( ) , userProps ) ; } catch ( IOException ex ) { log . error ( null , ex ) ; } } return null ; }
Internal helper function to parse a user file . It assumes the calling function already has handled the locking .