private String getPasswordOnRecord ( final String username ) throws IOException { try ( val stream = Files . lines ( fileName . getFile ( ) . toPath ( ) ) ) { return stream . map ( line -> line . split ( this . separator ) ) . filter ( lineFields -> { val userOnRecord = lineFields [ 0 ] ; return username . equals ( userOnRecord ) ; } ) . map ( lineFields -> lineFields [ 1 ] ) . findFirst ( ) . orElse ( null ) ; } }
Gets the password on record .