public static void main ( String [ ] args ) { if ( args . length < 2 ) { System . err . println ( "Two arguments needed as username and password" ) ; System . exit ( - 1 ) ; } User user = new User ( ) ; user . name = args [ 0 ] ; user . password . setPassword ( args [ 1 ] . toCharArray ( ) ) ; for ( int i = 2 ; i < args . length ; i ++ ) { user . roles . add ( new UserRole ( args [ i ] . trim ( ) ) ) ; } System . out . println ( user . format ( ) ) ; }
Can be used to create entries in the users textfile