private static String getRepoWS ( String [ ] args , int curArg ) { if ( curArg == args . length ) { System . out . println ( INCORRECT_PARAM + "There is no path to workspace parameter." ) ; //NOSONAR return null ; } // make correct path String repWS = args [ curArg ] ; repWS = repWS . replaceAll ( "\\\\" , "/" ) ; if ( ! repWS . matches ( "[/][^/]+" ) && ! repWS . matches ( "[/][^/]+[/][^/]+" ) ) { System . out . println ( INCORRECT_PARAM + "There is incorrect path to workspace parameter: " + repWS ) ; //NOSONAR return null ; } else { return repWS ; } }
Get parameter from argument list check it and return as valid path to repository and workspace .