Пример #1
0
 public static String resolveTrackArtist(String trackArtist) {
   if (StringUtils.containsIgnoreCase(trackArtist, "feat.")) {
     String[] strings = StringUtils.splitByWholeSeparator(trackArtist.toLowerCase(), "feat.");
     if (strings.length > 1) {
       return strings[2].trim();
     }
   }
   return trackArtist;
 }
  /**
   * 获取服务指定小区列表的相关厂家客服人员列表
   *
   * @param subdisIds 小区编号,多个的话逗号分隔
   * @param callBack
   */
  public void getSellSupportsByPowner(
      String subdisIds, NetProcessor.QueryRsProcessor<Human> callBack) {
    AjaxParams params = new AjaxParams();
    params.put("subdisIds", subdisIds);

    // 兼容老的服务器端,后面可以去掉
    String[] segs = StringUtils.splitByWholeSeparator(subdisIds, ",");
    params.put("subdisId", segs[0]);
    super.query(params, callBack, "/priv/subdist/sellSupports");
  }
Пример #3
0
  private boolean authenticate(HttpServerRequest request) {
    String authString = request.headers().get(HttpHeaders.AUTHORIZATION);

    if (authString == null) return false;

    String[] basicAuth = StringUtils.splitByWholeSeparator(authString, "Basic "); // $NON-NLS-1$

    if (basicAuth.length == 1) {
      return basicAuth(request, basicAuth[0]);
    }

    return false;
  }
Пример #4
0
  /**
   * 获取属性名字路径
   *
   * @param propertyName 属性名
   * @param root Query roots always reference entities
   * @return {@link Path}
   */
  public static Path<?> getPath(String propertyName, Root<?> root) {

    Path<?> path = null;

    if (StringUtils.contains(propertyName, ".")) {
      String[] propertys = StringUtils.splitByWholeSeparator(propertyName, ".");
      path = root.get(propertys[0]);
      for (int i = 1; i < propertys.length; i++) {
        path = path.get(propertys[i]);
      }
    } else {
      path = root.get(propertyName);
    }

    return path;
  }
  public List<EntityWrapper<Human>> getSellSupportsByPowner(String subdisIds, String roleType) {
    AjaxParams params = new AjaxParams();
    params.put("subdisIds", subdisIds);

    params.put("roleType", roleType);
    if (TextUtils.isEmpty(subdisIds)) {
      String[] segs = StringUtils.splitByWholeSeparator(subdisIds, ",");
      params.put("subdisId", segs[0]);
    }
    String result =
        (String)
            NetFactory.getHttp()
                .postSync(NetFactory.getServerUrl() + "/priv/subdist/sellSupports", params);
    List<EntityWrapper<Human>> humans = JsonParser.parseArray(result, Human.class);
    return humans;
  }
Пример #6
0
 /** 分割固定格式的字符串 */
 public static String[] splitString(String str, String separator) {
   return StringUtils.splitByWholeSeparator(str, separator);
 }
  /**
   * 将得到值与指定分割符号,分割,得到数组
   *
   * @param value 值
   * @param type 值类型
   * @return Object
   */
  public Object convertMatchValue(String value, Class<?> type) {
    Assert.notNull(value, "值不能为空");
    String[] result = StringUtils.splitByWholeSeparator(value, getAndValueSeparator());

    return ConvertUtils.convertToObject(result, type);
  }
Пример #8
0
 public static String[] split(String str, String splitStrNotRegex) {
   return StringUtils.splitByWholeSeparator(str, splitStrNotRegex);
 }