當前位置: 首頁>>代碼示例>>Java>>正文


Java StringUtils類代碼示例

本文整理匯總了Java中com.huawei.esdk.platform.common.utils.StringUtils的典型用法代碼示例。如果您正苦於以下問題:Java StringUtils類的具體用法?Java StringUtils怎麽用?Java StringUtils使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


StringUtils類屬於com.huawei.esdk.platform.common.utils包,在下文中一共展示了StringUtils類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getAllAppMappings

import com.huawei.esdk.platform.common.utils.StringUtils; //導入依賴的package包/類
@Override
public List<AppMappingConfig> getAllAppMappings()
{
    List<AppMappingConfig> result = appMappingDAO.getAllAppMappings();
    if (null != result && !result.isEmpty())
    {
        for (AppMappingConfig item : result)
        {
            if (null != item && !StringUtils.isEmpty(item.getDeviceAppPwd()))
            {
                item.setDeviceAppPwd(AES128System.decryptPwdByOldKey(item.getDeviceApp(), item.getDeviceAppPwd()));
            }
        }
    }
    return result;
}
 
開發者ID:Huawei,項目名稱:eSDK_IVS_Java,代碼行數:17,代碼來源:AppMappingConfigService.java

示例2: validateTargets

import com.huawei.esdk.platform.common.utils.StringUtils; //導入依賴的package包/類
private boolean validateTargets(List<String> strs)
{
    if (null == strs || 0 == strs.size())
    {
        return true;
    }
    
    for (String str : strs)
    {
        if (StringUtils.isEmpty(str))
        {
            return true;
        }
    }
    
    return false;
}
 
開發者ID:Huawei,項目名稱:eSDK_EC_SDK_Java,代碼行數:18,代碼來源:AppUserStatesResource.java

示例3: validateTargets

import com.huawei.esdk.platform.common.utils.StringUtils; //導入依賴的package包/類
public boolean validateTargets(List<String> strs)
{
    if (null == strs || 0 == strs.size())
    {
        return true;
    }
    
    for (String str : strs)
    {
        if (StringUtils.isEmpty(str))
        {
            return true;
        }
    }
    
    return false;
}
 
開發者ID:Huawei,項目名稱:eSDK_EC_SDK_Java,代碼行數:18,代碼來源:GroupResourceConvert.java

示例4: appSendMsgToDeptRest2Modal

import com.huawei.esdk.platform.common.utils.StringUtils; //導入依賴的package包/類
public DeptInstanceMessage appSendMsgToDeptRest2Modal(AppSendMsgToDept msg) throws SDKException
{
    DeptInstanceMessage im = new DeptInstanceMessage();
    im.setSender(msg.getSendNumber());
    im.setDeptNo(msg.getDeptId());
    im.setContent(msg.getMessage());
    im.setSubject(msg.getSubject());
    im.setDeptGrade(msg.getDeptGrade());
    
    if(StringUtils.isNotEmpty(msg.getPriorityLevel()))
    {
        try
        {
            im.setPriorityLevel(Integer.parseInt(msg.getPriorityLevel()));
        }
        catch(NumberFormatException e)
        {
            SDKException sdkException = new SDKException(ErrInfo.SDK_UC_PARAM_NOT_CORRECT_ERRORCODESC);
            sdkException.setSdkErrCode(ErrInfo.SDK_UC_PARAM_NOT_CORRECT_ERRORCODE);
            throw sdkException;
        }
    }
    return im;
}
 
開發者ID:Huawei,項目名稱:eSDK_EC_SDK_Java,代碼行數:25,代碼來源:IMResourceConvert.java

示例5: getQueryConfResponseModel2Rest

import com.huawei.esdk.platform.common.utils.StringUtils; //導入依賴的package包/類
public QueryConfResponse getQueryConfResponseModel2Rest(SDKResult<List<Conference>> result)
{
    QueryConfResponse response = new QueryConfResponse();
    response.setResultCode(String.valueOf(result.getErrCode()));
    response.setResultContext(StringUtils.avoidNull(result.getDescription()));
    
    
    List<Conference> confModels = result.getResult();
    if (null != confModels && !confModels.isEmpty())
    {
        List<QueryConferenceInfo> confs = new ArrayList<QueryConferenceInfo>();
        response.setConfs(confs);
        
        QueryConferenceInfo conf = null;
        for (Conference confModel : confModels)
        {
            conf = getConferenceInfoModel2Rest(confModel);
            if (null != conf)
            {
                confs.add(conf);
            }
        }
    }
    
    return response;
}
 
開發者ID:Huawei,項目名稱:eSDK_EC_SDK_Java,代碼行數:27,代碼來源:CTCResourceConvert.java

示例6: isEmptyAttendeeRequest

import com.huawei.esdk.platform.common.utils.StringUtils; //導入依賴的package包/類
private boolean isEmptyAttendeeRequest(AttendeeRequest attendeeRequest)
{
    if (null == attendeeRequest)
    {
        return true;
    }
    
    if (StringUtils.isEmpty(attendeeRequest.getAccount()) || StringUtils.isEmpty(attendeeRequest.getAttNumber())
        || StringUtils.isEmpty(attendeeRequest.getAttType()) || StringUtils.isEmpty(attendeeRequest.getConfId())
        || StringUtils.isEmpty(attendeeRequest.getSubPbx()) || StringUtils.isEmpty(attendeeRequest.getUserId())
        || StringUtils.isEmpty(attendeeRequest.getGwIp()))
    //|| StringUtils.isEmpty(attendeeRequest.getAttStatus()) 
    //|| StringUtils.isEmpty(attendeeRequest.getEmail()) 
    //|| StringUtils.isEmpty(attendeeRequest.getSpeakStatus())
    {
        return true;
    }
    
    return false;
}
 
開發者ID:Huawei,項目名稱:eSDK_EC_SDK_Java,代碼行數:21,代碼來源:AttendeeResource.java

示例7: getAccountModel2Rest

import com.huawei.esdk.platform.common.utils.StringUtils; //導入依賴的package包/類
public RestResponse<GetAccountResponse> getAccountModel2Rest(SDKResult<BatchAccount> result)
{
    RestResponse<GetAccountResponse> response = new RestResponse<GetAccountResponse>();
    response.setResultCode(String.valueOf(result.getErrCode()));
    response.setResultContext(StringUtils.avoidNull(result.getDescription()));
    BatchAccount modelAccount = result.getResult();
    if (null != modelAccount)
    {
        GetAccountResponse accoutRes = new GetAccountResponse();
        response.setResult(accoutRes);
        accoutRes.setAmount(modelAccount.getSuccessAmount());
        
        List<Account> accounts = modelAccount.getAccountIds();
        if (null != accounts && !accounts.isEmpty())
        {
            List<AccountResponse> rests = new ArrayList<AccountResponse>();
            accoutRes.setAccounts(rests);
            for (Account account : accounts)
            {
                rests.add(getAccountModel2Rest(account));
            }
        }
    }
    
    return response;
}
 
開發者ID:Huawei,項目名稱:eSDK_EC_SDK_Java,代碼行數:27,代碼來源:AccountResourceConvert.java

示例8: buildHttpHost

import com.huawei.esdk.platform.common.utils.StringUtils; //導入依賴的package包/類
private HttpHost buildHttpHost()
{
    if (StringUtils.isEmpty(serverUrl))
    {
        return null;
    }
    
    HttpHost result;
    
    String scheme = serverUrl.substring(0, serverUrl.indexOf("://"));
    String server = serverUrl.substring(serverUrl.indexOf("://") + 3, serverUrl.indexOf("/", scheme.length() + 3));
    if (server.contains(":"))
    {
        result = new HttpHost(server.split(":")[0], Integer.valueOf(server.split(":")[1]), scheme);
    }
    else
    {
        result = new HttpHost(server, 80, scheme);
    }
    
    return result;
}
 
開發者ID:Huawei,項目名稱:eSDK_EC_SDK_Java,代碼行數:23,代碼來源:RestfulAdapterImplHttpClient.java

示例9: preSend

import com.huawei.esdk.platform.common.utils.StringUtils; //導入依賴的package包/類
private void preSend(RestReqMessage restReq)
{
    if (null != sdkProtocolAdatperCustProvider)
    {
        AccountInfo accountInfo = sdkProtocolAdatperCustProvider.getProtocolAuthInfo();
        if (null != accountInfo && null != accountInfo.getUserId())
        {
            if (!StringUtils.strsEquals(accountInfo.getUserId(), user) || !StringUtils.strsEquals(accountInfo.getPassword(), pwd))
            {
                httpClient.getCredentialsProvider().setCredentials(new AuthScope(target.getHostName(),
                    target.getPort()),
                    new UsernamePasswordCredentials(accountInfo.getUserId(), accountInfo.getPassword()));
                this.user = accountInfo.getUserId();
                this.pwd = accountInfo.getPassword();
            }
        }
        
        sdkProtocolAdatperCustProvider.preProcessReq(restReq);
        sdkProtocolAdatperCustProvider.preSend(restReq);
    }
}
 
開發者ID:Huawei,項目名稱:eSDK_EC_SDK_Java,代碼行數:22,代碼來源:RestfulAdapterImplHttpClient.java

示例10: preSend

import com.huawei.esdk.platform.common.utils.StringUtils; //導入依賴的package包/類
private void preSend(RestReqMessage restReq)
{
    if (null != sdkProtocolAdatperCustProvider)
    {
        AccountInfo accountInfo = sdkProtocolAdatperCustProvider.getProtocolAuthInfo();
        if (null != accountInfo && null != accountInfo.getUserId())
        {
            if (!StringUtils.strsEquals(accountInfo.getUserId(), user)
                || !StringUtils.strsEquals(accountInfo.getPassword(), pwd))
            {
                httpClient.getCredentialsProvider().setCredentials(new AuthScope(target.getHostName(),
                    target.getPort()),
                    new UsernamePasswordCredentials(accountInfo.getUserId(), accountInfo.getPassword()));
                this.user = accountInfo.getUserId();
                this.pwd = accountInfo.getPassword();
            }
        }
        
        sdkProtocolAdatperCustProvider.preProcessReq(restReq);
        sdkProtocolAdatperCustProvider.preSend(restReq);
    }
}
 
開發者ID:Huawei,項目名稱:eSDK_EC_SDK_Java,代碼行數:23,代碼來源:RestfulAdapterImplHttpClientHTLS.java

示例11: buildLogMsg

import com.huawei.esdk.platform.common.utils.StringUtils; //導入依賴的package包/類
private String buildLogMsg(InterfaceLogBean logBean)
{
    //接口日誌設計格式
    //日期時間|級別|請求響應標識|接口所屬業務|接口類型|接口名稱|源端設備|宿端設備|會話標識|請求響應參數。
    //日期時間|級別 用Log4j組件輸出
    StringBuilder sb = new StringBuilder();
    if (null != logBean)
    {
        sb.append(logBean.getProduct()).append("|");
        sb.append(logBean.getInterfaceType()).append("|");
        sb.append(logBean.getProtocolType()).append("|");
        sb.append(logBean.getName()).append("|");
        sb.append(logBean.getSourceAddr()).append("|");
        sb.append(logBean.getTargetAddr()).append("|");
        sb.append(StringUtils.avoidNull(logBean.getTransactionId())).append("|");
        sb.append(logBean.getReqTimeAsString()).append("|");
        sb.append(logBean.getRespTimeAsString()).append("|");
        sb.append(StringUtils.avoidNull(logBean.getReqParams())).append("|");
        sb.append(logBean.getResultCode()).append("|");
        sb.append(StringUtils.avoidNull(logBean.getRespParams()));
    }
    
    return sb.toString();
}
 
開發者ID:Huawei,項目名稱:eSDK_EC_SDK_Java,代碼行數:25,代碼來源:InterfaceLog.java

示例12: moveFile

import com.huawei.esdk.platform.common.utils.StringUtils; //導入依賴的package包/類
private String moveFile(String logFile)
{
    if (StringUtils.isEmpty(logFile))
    {
        return logFile;
    }
    
    File file = new File(logFile);
    //Move the file to temp folder for uploading
    File destFile = new File(file.getParent() + File.separator + "temp" + File.separator + file.getName());
    try
    {
        if (destFile.exists())
        {
            destFile.delete();
        }
        FileUtils.moveFile(file, destFile);
        file = destFile;
    }
    catch (IOException e)
    {
        LOGGER.error("", e);
    }
    
    return file.getPath();
}
 
開發者ID:Huawei,項目名稱:eSDK_EC_SDK_Java,代碼行數:27,代碼來源:LogFileUploaderTask.java

示例13: getProductFromDevType

import com.huawei.esdk.platform.common.utils.StringUtils; //導入依賴的package包/類
private String getProductFromDevType()
{
    LOGGER.debug("deviceType=" + deviceType);
    String product = (String) ThreadLocalHolder.get().getEntities().get(ESDKConstant.CURRENT_PRODUCT);
    if (StringUtils.isNotEmpty(product))
    {
        LOGGER.debug("product from thread local is " + product);
        return product;
    }
    
    String className = DeviceConfigLoader.getDeviceProxyConfig(deviceType).getClassName();
    for (Map.Entry<String, String> entry : productAuthPolicyMappings.entrySet())
    {
        if (className.contains(entry.getKey()))
        {
            return entry.getValue();
        }
    }
    LOGGER.warn("The derived product is empty");
    return "";
}
 
開發者ID:Huawei,項目名稱:eSDK_EC_SDK_Java,代碼行數:22,代碼來源:DeviceInstance.java

示例14: parseConfigFile

import com.huawei.esdk.platform.common.utils.StringUtils; //導入依賴的package包/類
private List<ConfigItem> parseConfigFile(Properties props)
{
    List<ConfigItem> result = new ArrayList<ConfigItem>();
    if (null != props)
    {
        ConfigItem configItem;
        for (Entry<Object, Object> config : props.entrySet())
        {
            configItem = new ConfigItem();
            configItem.setKey((String)config.getKey());
            configItem.setValue(StringUtils.trim((String)config.getValue()));
            result.add(configItem);
            CONFIG_ITEMS.put((String)config.getKey(), configItem);
        }
    }
    
    return result;
}
 
開發者ID:Huawei,項目名稱:eSDK_EC_SDK_Java,代碼行數:19,代碼來源:ConfigManagerNoDecrypt.java

示例15: parseConfigFile

import com.huawei.esdk.platform.common.utils.StringUtils; //導入依賴的package包/類
private static List<ConfigItem> parseConfigFile(Properties props)
{
    List<ConfigItem> result = new ArrayList<ConfigItem>();
    if (null != props)
    {
        ConfigItem configItem;
        for (Entry<Object, Object> config : props.entrySet())
        {
            configItem = new ConfigItem();
            configItem.setKey((String)config.getKey());
            configItem.setValue(StringUtils.trim((String)config.getValue()));
            result.add(configItem);
            CONFIG_ITEMS.put((String)config.getKey(), configItem);
        }
    }
    
    return result;
}
 
開發者ID:Huawei,項目名稱:eSDK_EC_SDK_Java,代碼行數:19,代碼來源:ConfigManagerUpdate.java


注:本文中的com.huawei.esdk.platform.common.utils.StringUtils類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。