/** * <p>Replace all occurances of a String within another String.</p> * * <p>A <code>null</code> reference passed to this method is a no-op.</p> * * @see #replace(String text, String repl, String with, int max) * @param text text to search and replace in * @param repl String to search for * @param with String to replace with * @return the text with any replacements processed */ public static String replace( String text, String repl, String with ) { return replace( text, repl, with, -1 ); }
String methodBase = StringUtils.capitalizeFirstLetter( token );
private CRole buildRole( Entry<String, ContentClass> entry, String method ) { String content = entry.getKey(); CRole view = new CRole(); view.setId( content + "-all-" + method ); String contentClassName = entry.getValue().getName(); if ( entry.getValue() instanceof RootContentClass ) { // NXCM-3544 set name to empty string to generate 'All Repositories' role name/description contentClassName = ""; } view.setDescription( "Gives access to " + method + " ALL " + contentClassName + " Repositories in Nexus." ); method = StringUtils.capitalizeFirstLetter( method ); view.setName( "Repo: All " + contentClassName + " Repositories (" + method + ")" ); view.setSessionTimeout( 60 ); List<? extends Repository> repos = getRepositoriesWithContentClass( entry.getValue() ); for ( Repository repo : repos ) { view.addPrivilege( "repository-" + repo.getId() ); } return view; }
result = StringUtils.replace( result, wholeExpr, String.valueOf( value ) );