本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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();
}
示例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();
}
示例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 "";
}
示例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;
}
示例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;
}