public static List < String > getNodeListFromStringLineSeperateOrSpaceSeperate ( String listStr , boolean removeDuplicate ) { List < String > nodes = new ArrayList < String > ( ) ; for ( String token : listStr . split ( "[\\r?\\n| +]+" ) ) { // 20131025: fix if fqdn has space in the end. if ( token != null && ! token . trim ( ) . isEmpty ( ) ) { nodes . add ( token . trim ( ) ) ; } } if ( removeDuplicate ) { removeDuplicateNodeList ( nodes ) ; } logger . info ( "Target hosts size : " + nodes . size ( ) ) ; return nodes ; }
Gets the node list from string line seperate or space seperate .