private List < String > parseParams ( String param ) { Assert . hasText ( param , "param must not be empty nor null" ) ; List < String > paramsToUse = new ArrayList <> ( ) ; Matcher regexMatcher = DEPLOYMENT_PARAMS_PATTERN . matcher ( param ) ; int start = 0 ; while ( regexMatcher . find ( ) ) { String p = removeQuoting ( param . substring ( start , regexMatcher . start ( ) ) . trim ( ) ) ; if ( StringUtils . hasText ( p ) ) { paramsToUse . add ( p ) ; } start = regexMatcher . start ( ) ; } if ( param != null && param . length ( ) > 0 ) { String p = removeQuoting ( param . substring ( start , param . length ( ) ) . trim ( ) ) ; if ( StringUtils . hasText ( p ) ) { paramsToUse . add ( p ) ; } } return paramsToUse ; }
Parses a string of space delimited command line parameters and returns a list of parameters which doesn t contain any special quoting either for values or whole parameter .