public List < Role > findAllRoles ( ) { List < Role > list = new ArrayList <> ( ) ; List < String > roleStrings ; try { roleStrings = readLines ( rolesFile ) ; } catch ( IOException e ) { throw new FileBasedRuntimeException ( e ) ; } for ( String roleString : roleStrings ) { if ( StringUtils . isNotBlank ( roleString ) ) { String [ ] substrings = StringUtils . splitByWholeSeparator ( roleString , Configuration . get ( ) . getAssociationSeparator ( ) ) ; if ( substrings . length < 1 || StringUtils . isBlank ( substrings [ 0 ] ) ) { continue ; } Role role = new Role ( substrings [ 0 ] ) ; if ( substrings . length > 1 ) { role . setRoles ( Arrays . asList ( StringUtils . splitByWholeSeparator ( substrings [ 1 ] , Configuration . get ( ) . getValueSeparator ( ) ) ) ) ; } list . add ( role ) ; } } return list ; }
Finds all the available roles .