List of usage examples for org.apache.commons.lang StringUtils substringAfter
public static String substringAfter(String str, String separator)
Gets the substring after the first occurrence of a separator.
From source file:com.prowidesoftware.swift.model.mt.AbstractMT.java
public String nameFromClass() { return StringUtils.substringAfter(getClass().getName(), ".MT"); }
From source file:br.com.bropenmaps.util.Util.java
/** * Extrai os parmetros de uma requisio HTTP * @param query - query string//from www. j ava2s .c o m * @return Objeto {@link HashMap} contendo os parmetros */ public static HashMap<String, String> extraiParametros(String query) { if (query == null) { return null; } final HashMap<String, String> param = new HashMap<String, String>(); String[] tk = StringUtils.split(query, "&"); for (String p : tk) { param.put(StringUtils.substringBefore(p, "="), StringUtils.substringAfter(p, "=")); } return param; }
From source file:br.com.bropenmaps.util.Util.java
/** * Extrai os parmetros de uma requisio HTTP. A string da requisio, neste caso, est criptografada. * @param query - query string/*from w w w . jav a2s. com*/ * @return Objeto {@link HashMap} contendo os parmetros */ public static HashMap<String, String> extraiParametrosCript(String query) { if (query == null) { return null; } CriptUtils cript = new CriptUtils(ResourceBundle.getBundle("cript").getString("chave")); query = cript.decrypt(query); final HashMap<String, String> param = new HashMap<String, String>(); String[] tk = StringUtils.split(query, "&"); for (String p : tk) { param.put(StringUtils.substringBefore(p, "="), StringUtils.substringAfter(p, "=")); } return param; }
From source file:eionet.cr.web.action.factsheet.FolderActionBean.java
/** * Renames corresponding ACLs of the renamed folders. * * @param renamings renamings hash keys: old urls, values: new urls */// w ww.j a v a 2s. com private void renameAcls(HashMap<String, String> renamings) { String appHome = GeneralConfig.getProperty(GeneralConfig.APPLICATION_HOME_URL); for (String oldUri : renamings.keySet()) { String path = StringUtils.substringAfter(oldUri, appHome); try { if (AccessController.getAcls().containsKey(path)) { String newAclPath = StringUtils.substringAfter(renamings.get(oldUri), appHome); AccessController.renameAcl(path, newAclPath); } } catch (SignOnException e) { e.printStackTrace(); } } }
From source file:edu.cornell.kfs.coa.document.validation.impl.AccountReversionGlobalRule.java
/** * Validates that the fund group code on the sub fund group on the reversion account is valid as defined by the allowed * values in SELECTION_1 system parameter. * /*from w w w. ja v a2 s . c o m*/ * @param acctRev * @return true if valid, false otherwise */ protected boolean validateAccountFundGroup(AccountReversionGlobalAccount acctRev) { boolean valid = true; String fundGroups = SpringContext.getBean(ParameterService.class).getParameterValueAsString(Reversion.class, CUKFSConstants.Reversion.SELECTION_1); String propertyName = StringUtils.substringBefore(fundGroups, "="); List<String> ruleValues = Arrays.asList(StringUtils.substringAfter(fundGroups, "=").split(";")); if (ObjectUtils.isNotNull(ruleValues) && ruleValues.size() > 0) { if (ObjectUtils.isNotNull(acctRev.getAccount()) && ObjectUtils.isNotNull(acctRev.getAccount().getSubFundGroup())) { String accountFundGroupCode = acctRev.getAccount().getSubFundGroup().getFundGroupCode(); if (!ruleValues.contains(accountFundGroupCode)) { valid = false; GlobalVariables.getMessageMap().putError(CUKFSPropertyConstants.ACCT_REVERSION_ACCT_NUMBER, RiceKeyConstants.ERROR_DOCUMENT_INVALID_VALUE_ALLOWED_VALUES_PARAMETER, new String[] { getDataDictionaryService().getAttributeLabel(FundGroup.class, KFSPropertyConstants.CODE), accountFundGroupCode, getParameterAsStringForMessage(CUKFSConstants.Reversion.SELECTION_1), getParameterValuesForMessage(ruleValues), getDataDictionaryService().getAttributeLabel(AccountReversion.class, CUKFSPropertyConstants.ACCT_REVERSION_ACCT_NUMBER) }); } } } return valid; }
From source file:com.wlami.mibox.client.metadata.MetadataWorker.java
/** * @param appSettings/*from w w w . j av a 2 s. c o m*/ * @param filename * @return */ public String getRelativePath(AppSettings appSettings, String filename) { return StringUtils.substringAfter(FilenameUtils.separatorsToUnix(filename), appSettings.getWatchDirectory()); }
From source file:com.oneops.controller.cms.CmsWoProvider.java
Map<String, String> getVarsForConfig(String nsPath, String className) { final Map<String, String> varMap = new HashMap<>(); for (String prefix : new String[] { "bom", cmsUtil.getShortClazzName(className) }) { List<CmsVar> vars = cmProcessor.getCmVarByLongestMatchingCriteria(prefix + ".%", nsPath); if (vars != null && !vars.isEmpty()) { vars.forEach(//from ww w. j a va 2 s . c o m var -> varMap.put(StringUtils.substringAfter(var.getName(), prefix + "."), var.getValue())); } } return varMap.isEmpty() ? null : varMap; }
From source file:ch.algotrader.esper.EngineImpl.java
private Module getModule(String moduleName) { try {/*from w w w .j av a2 s .co m*/ String fileName = "module-" + moduleName + ".epl"; InputStream stream = getClass().getResourceAsStream("/" + fileName); if (stream == null) { throw new IllegalArgumentException(fileName + " does not exist"); } // process loads try (BufferedReader reader = new BufferedReader(new InputStreamReader(stream))) { StringWriter buffer = new StringWriter(); String strLine; while ((strLine = reader.readLine()) != null) { if (!strLine.startsWith("load")) { buffer.append(strLine); buffer.append(newline); } else { String argument = StringUtils.substringAfter(strLine, "load").trim(); String moduleBaseName = argument.split("\\.")[0]; String statementName = argument.split("\\.")[1].split(";")[0]; Module module = EPLModuleUtil.readResource("module-" + moduleBaseName + ".epl"); for (ModuleItem item : module.getItems()) { if (item.getExpression().contains("@Name('" + statementName + "')")) { buffer.append(item.getExpression()); buffer.append(";"); buffer.append(newline); break; } } } } return EPLModuleUtil.parseInternal(buffer.toString(), fileName); } } catch (ParseException | IOException ex) { throw new InternalEngineException(moduleName + " could not be deployed", ex); } }
From source file:eionet.cr.staging.exp.ExportRunner.java
/** * * @param str//from w w w .java 2 s.c o m * @return */ public static LinkedHashMap<String, List<String>> missingConceptsFromString(String str) { LinkedHashMap<String, List<String>> result = new LinkedHashMap<String, List<String>>(); if (StringUtils.isNotBlank(str)) { String[] lines = StringUtils.split(str, '\n'); for (int i = 0; i < lines.length; i++) { String line = lines[i].trim(); String type = StringUtils.substringBefore(line, ":").trim(); if (StringUtils.isNotBlank(type)) { String csv = StringUtils.substringBefore(StringUtils.substringAfter(line, "["), "]").trim(); if (StringUtils.isNotBlank(csv)) { List<String> values = Arrays.asList(StringUtils.split(csv, ", ")); if (!values.isEmpty()) { result.put(type, values); } } } } } return result; }
From source file:edu.cornell.kfs.coa.document.validation.impl.AccountReversionGlobalRule.java
/** * Validates that the sub fund group code on the reversion account is valid as defined by the allowed values in * SELECTION_4 system parameter.//w ww. ja v a 2s. c o m * * @param acctRev * @return true if valid, false otherwise */ protected boolean validateAccountSubFundGroup(AccountReversionGlobalAccount acctRev) { boolean valid = true; String subFundGroups = SpringContext.getBean(ParameterService.class) .getParameterValueAsString(Reversion.class, CUKFSConstants.Reversion.SELECTION_4); String propertyName = StringUtils.substringBefore(subFundGroups, "="); List<String> ruleValues = Arrays.asList(StringUtils.substringAfter(subFundGroups, "=").split(";")); if (ObjectUtils.isNotNull(ruleValues) && ruleValues.size() > 0) { if (ObjectUtils.isNotNull(acctRev.getAccount())) { String accountSubFundGroupCode = acctRev.getAccount().getSubFundGroupCode(); if (ruleValues != null && ruleValues.size() > 0 && ruleValues.contains(accountSubFundGroupCode)) { valid = false; GlobalVariables.getMessageMap().putError(CUKFSPropertyConstants.ACCT_REVERSION_ACCT_NUMBER, RiceKeyConstants.ERROR_DOCUMENT_INVALID_VALUE_DENIED_VALUES_PARAMETER, new String[] { getDataDictionaryService().getAttributeLabel(SubFundGroup.class, KFSPropertyConstants.SUB_FUND_GROUP_CODE), accountSubFundGroupCode, getParameterAsStringForMessage(CUKFSConstants.Reversion.SELECTION_4), getParameterValuesForMessage(ruleValues), getDataDictionaryService().getAttributeLabel(AccountReversion.class, CUKFSPropertyConstants.ACCT_REVERSION_ACCT_NUMBER) }); } } } return valid; }