/** * * @param s A String that may contain %token% * @return the UNIX-ified format ${token} */ private String windowsToUnixTokens(String s) { String replaced = s; while (true) { if (replaced == null || replaced.indexOf('%') < 0) { break; } replaced = GFLauncherUtils.replace(replaced, "%", "${"); replaced = GFLauncherUtils.replace(replaced, "%", "}"); } if (replaced == null) { return s; } else { return replaced; } }
/** * * @param s A String that may contain %token% * @return the UNIX-ified format ${token} */ private String windowsToUnixTokens(String s) { String replaced = s; while (true) { if (replaced == null || replaced.indexOf('%') < 0) { break; } replaced = GFLauncherUtils.replace(replaced, "%", "${"); replaced = GFLauncherUtils.replace(replaced, "%", "}"); } if (replaced == null) { return s; } else { return replaced; } }
/** * * @param s A String that may contain %token% * @return the UNIX-ified format ${token} */ private String windowsToUnixTokens(String s) { String replaced = s; while (true) { if (replaced == null || replaced.indexOf('%') < 0) { break; } replaced = GFLauncherUtils.replace(replaced, "%", "${"); replaced = GFLauncherUtils.replace(replaced, "%", "}"); } if (replaced == null) { return s; } else { return replaced; } }
/** * Replace $[variables} with a matching property in the map * @param s String to be token-replaced * @return the replaced String */ public String resolve(String s) { if(s == null || s.length() <= 0) return s; if (hasWindowsToken(s)) { s = windowsToUnixTokens(s); } List<Token> tokens = getTokens(s); String resolved = s; for (Token token : tokens) { resolved = GFLauncherUtils.replace(resolved, token.token, token.value); } return resolved; }
/** * Replace $[variables} with a matching property in the map * @param s String to be token-replaced * @return the replaced String */ public String resolve(String s) { if(s == null || s.length() <= 0) return s; if (hasWindowsToken(s)) { s = windowsToUnixTokens(s); } List<Token> tokens = getTokens(s); String resolved = s; for (Token token : tokens) { resolved = GFLauncherUtils.replace(resolved, token.token, token.value); } return resolved; }
/** * Replace $[variables} with a matching property in the map * @param s String to be token-replaced * @return the replaced String */ public String resolve(String s) { if(s == null || s.length() <= 0) return s; if (hasWindowsToken(s)) { s = windowsToUnixTokens(s); } List<Token> tokens = getTokens(s); String resolved = s; for (Token token : tokens) { resolved = GFLauncherUtils.replace(resolved, token.token, token.value); } return resolved; }