List of usage examples for org.apache.commons.lang StringUtils split
public static String[] split(String str, String separatorChars)
Splits the provided text into an array, separators specified.
From source file:com.github.dbourdette.otto.source.Event.java
public static Event fromKeyValues(String keyValues) { Event event = new Event(); for (String token : StringUtils.split(keyValues, ",")) { String[] keyValue = StringUtils.split(token, "="); event.parseValue(keyValue[0], keyValue[1]); }/*from w ww .j a va2 s . c o m*/ return event; }
From source file:com.redhat.rhn.manager.kickstart.IpAddress.java
/** * * @param ipIn Ip Address in String Form *///from ww w . ja va2 s . c om public IpAddress(String ipIn) { this(); if (StringUtils.isEmpty(ipIn)) { throw new InvalidIpAddressException(StringUtils.defaultString(ipIn)); } String[] soctets = StringUtils.split(ipIn, "."); if (soctets.length == 4) { try { for (int i = 0; i < 4; i++) { setOctet(i, new Long(soctets[i])); } } catch (NumberFormatException num) { throw new InvalidIpAddressException(ipIn); } } else { throw new InvalidIpAddressException(ipIn); } }
From source file:com.hangum.tadpole.rdb.core.actions.adapter.rdb.DBTypeActionFilterAdapter.java
@Override public boolean testAttribute(Object target, String name, String value) { UserDBDAO userDB = null;/*www.j a va 2s . c om*/ if (target instanceof UserDBDAO) { userDB = (UserDBDAO) target; // db ? ?. if (DB_TYPE.equals(name)) { String[] dbTypes = StringUtils.split(value, ","); for (String dbType : dbTypes) { if (userDB.getDbms_type().equalsIgnoreCase(dbType)) { return true; } } // ? ? ?. } else if (USER_TYPE.equals(name)) { final String[] userTypes = StringUtils.split(value, ","); final String strRoleType = userDB.getRole_id(); for (String userType : userTypes) { if (strRoleType.equalsIgnoreCase(userType)) { return true; } } } } return false; }
From source file:com.haulmont.cuba.web.auth.DefaultDomainAliasesResolver.java
@Inject public DefaultDomainAliasesResolver(Configuration configuration) { WebAuthConfig webConfig = configuration.getConfig(WebAuthConfig.class); String aliasesConfig = webConfig.getActiveDirectoryAliases(); if (StringUtils.isNotBlank(aliasesConfig)) { String[] aliasesPairs = StringUtils.split(aliasesConfig, ';'); for (String aliasDefinition : aliasesPairs) { // skip blank parts if (StringUtils.isNotBlank(aliasDefinition)) { String[] aliasParts = StringUtils.split(aliasDefinition, '|'); if (aliasParts == null || aliasParts.length != 2 || StringUtils.isBlank(aliasParts[0]) || StringUtils.isBlank(aliasParts[1])) { log.warn("Incorrect domain alias definition: '{}'", aliasDefinition); } else { aliases.put(aliasParts[0].toLowerCase(), aliasParts[1]); }/* ww w . j a v a 2 s . c om*/ } } } }
From source file:com.netflix.lipstick.adaptors.LOLoadJsonAdaptor.java
/** * Initializes a new LOLoadJsonAdaptor and additionally sets the storage * function and location on the P2jLOLoad object being created. * * @param node//from ww w . ja va2 s . c o m * @param lp * @throws FrontendException */ public LOLoadJsonAdaptor(LOLoad node, LogicalPlan lp) throws FrontendException { super(node, new P2jLOLoad(), lp); P2jLOLoad load = (P2jLOLoad) p2j; load.setStorageLocation(node.getFileSpec().getFileName()); String[] funcList = StringUtils.split(node.getFileSpec().getFuncName(), "."); load.setStorageFunction(funcList[funcList.length - 1]); }
From source file:gov.nih.nci.eagle.service.validation.ListValidationServiceImpl.java
private void buildMap() { dataPatientMap = new HashMap<SpecimenType, List>(); ReadablePropertyPlaceholder props = (ReadablePropertyPlaceholder) SpringContext.getBean("patientLists"); Properties properties = props.getProps(); String tissueTumor = properties.getProperty("data.tissue_tumor"); String tissueNormal = properties.getProperty("data.tissue_normal"); String blood = properties.getProperty("data.blood"); List normalList = Arrays.asList(StringUtils.split(tissueNormal, ",")); List tumorList = Arrays.asList(StringUtils.split(tissueTumor, ",")); List bloodList = Arrays.asList(StringUtils.split(blood, ",")); dataPatientMap.put(SpecimenType.BLOOD, bloodList); dataPatientMap.put(SpecimenType.TISSUE_CANCER, tumorList); dataPatientMap.put(SpecimenType.TISSUE_NORMAL, normalList); }
From source file:com.btobits.automator.ant.types.TimeValue.java
public TimeValue(final String inXmlValue) { this();/* ww w . j a v a 2s. co m*/ final String value[] = StringUtils.split(StringUtils.trim(inXmlValue), " "); switch (value.length) { case 1: duration = Long.parseLong(StringUtils.trim(value[0])); break; case 2: try { duration = Long.parseLong(StringUtils.trim(value[0])); unit = TimeUnit.valueOf(StringUtils.upperCase(StringUtils.trim(value[1]))); } catch (final IllegalArgumentException e) { throw new BuildException("Unable to extract time unit name from [" + value[1] + "]. Please use one of following: NANOSECONDS | MICROSECONDS | MILLISECONDS | SECONDS | MINUTES | HOURS | DAYS"); // log.error("catch generic exception: " + e); // log.error(StackTraceUtil.getStackTrace(e)); } break; default: throw new IllegalArgumentException("Unable to extract TimeValue from [" + inXmlValue + "]"); } }
From source file:com.pureinfo.srm.config.workflow.function.HonorGuarder.java
/** * @see com.pureinfo.ark.interaction.view.ViewGuarderImplBase#checkPass(com.pureinfo.ark.content.model.ArkContent, * com.pureinfo.ark.auth.model.IUser, java.lang.Object[]) *//*from w ww .java 2 s . com*/ protected boolean checkPass(ArkContent _content, IUser _user, Object[] _args) throws PureException { if (_args.length != 1) throw new PureException(PureException.INVALID_REQUEST, "args must have two arguments!"); if ("null".equals(_args[0])) { WfProcess process = WorkflowHelper.getHonorProcess(); return process != null ? true : false; } String[] acts = StringUtils.split((String) _args[0], "|"); for (int i = 0; i < acts.length; i++) { if (WorkflowHelper.checkHonorRole(acts[i], ((SRMUser) _user).getRolesList())) return true; } return false; }
From source file:com.google.gwt.dev.resource.impl.ZipFileResource.java
public ZipFileResource(ZipFileClassPathEntry classPathEntry, String path) { this.classPathEntry = classPathEntry; this.path = path; // >>> Instantiations this.pathParts = StringUtils.split(path, '/'); // <<< Instantiations }
From source file:com.daimler.spm.b2bacceleratoraddon.forms.AdvancedSearchForm.java
public List<String> getProductIdsList() { if (StringUtils.isNotBlank(getKeywords())) { if (CollectionUtils.isEmpty(productIdsList)) { this.productIdsList = new ArrayList<>(); }//from w w w. jav a 2 s . c o m this.productIdsList.addAll(Arrays.asList(StringUtils.split(getKeywords(), ",; "))); } return productIdsList; }