本文整理汇总了Java中org.apache.commons.lang3.StringUtils.EMPTY属性的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.EMPTY属性的具体用法?Java StringUtils.EMPTY怎么用?Java StringUtils.EMPTY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.commons.lang3.StringUtils
的用法示例。
在下文中一共展示了StringUtils.EMPTY属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkOrderInfo
public static String checkOrderInfo(TrainQuery query) {
CloseableHttpClient httpClient = buildHttpClient();
HttpPost httpPost = new HttpPost(UrlConfig.checkOrderInfo);
httpPost.addHeader(CookieManager.cookieHeader());
httpPost.setEntity(new StringEntity(genCheckOrderInfoParam(query), ContentType.create("application/x-www-form-urlencoded", Consts.UTF_8)));
String result = StringUtils.EMPTY;
try(CloseableHttpResponse response = httpClient.execute(httpPost)) {
CookieManager.touch(response);
result = EntityUtils.toString(response.getEntity());
} catch (IOException e) {
logger.error("checkUser error", e);
}
return result;
}
示例2: validateCreateRolesRequest
private String validateCreateRolesRequest(AppCreateDTO request) {
if (request == null || Util.isCollectionEmpty(request.getRoles())) {
return AdminErrorMessage.REGISTER_ROLES_FAIL_EMPTY_REQUEST;
}
else if(StringUtils.isEmpty(request.getColor())){
return AdminErrorMessage.REGISTER_ROLES_FAIL_INVALID_COLOR;
}
for (String role : request.getRoles()) {
if (rolesDAO.findByName(role) != null) {
return String.format(AdminErrorMessage.REGISTER_ROLES_FAIL_NAME_EXISTS, role);
}
}
return StringUtils.EMPTY;
}
示例3: getSanitizedDownloadPath
public static String getSanitizedDownloadPath(String downloadObjectKey) {
if (downloadObjectKey == null) {
log.info(LOGGER_KEY + "Download object key set to the root of the container. Null value specified");
downloadObjectKey = StringUtils.EMPTY;
}
if (downloadObjectKey.equalsIgnoreCase(PluginConstants.AZURE_FOLDER_SEPARATOR)) {
log.info(LOGGER_KEY + "Download object key set to the root of the container");
downloadObjectKey = StringUtils.EMPTY;
}
if (downloadObjectKey.startsWith(PluginConstants.AZURE_FOLDER_SEPARATOR)) {
log.info(LOGGER_KEY + "Removing leading forward-slashes from download object key");
downloadObjectKey = downloadObjectKey.substring(1, downloadObjectKey.length());
}
log.debug(LOGGER_KEY + "Formatting the Input to match Azure specification - " + downloadObjectKey);
return downloadObjectKey;
}
示例4: testPopulateGroupJvmTemplates
@Test
public void testPopulateGroupJvmTemplates() throws FileNotFoundException {
List<UploadJvmTemplateRequest> uploadCommands = new ArrayList<UploadJvmTemplateRequest>();
InputStream data = new FileInputStream(new File("./src/test/resources/ServerXMLTemplate.tpl"));
Scanner scanner = new Scanner(data).useDelimiter("\\A");
String templateContent = scanner.hasNext() ? scanner.next() : "";
UploadJvmTemplateRequest request = new UploadJvmTemplateRequest(preCreatedJvm, "ServerXMLTemplate.tpl", templateContent, StringUtils.EMPTY) {
@Override
public String getConfFileName() {
return "server.xml";
}
};
uploadCommands.add(request);
groupPersistenceService.populateGroupJvmTemplates(preCreatedGroup.getName(), uploadCommands);
}
示例5: getPassengers
public static String getPassengers() {
CloseableHttpClient httpClient = buildHttpClient();
HttpPost httpPost = new HttpPost(UrlConfig.passenger);
httpPost.addHeader(CookieManager.cookieHeader());
String result = StringUtils.EMPTY;
try(CloseableHttpResponse response = httpClient.execute(httpPost)) {
result = EntityUtils.toString(response.getEntity());
List<Passenger> passengers = PassengerUtil.parsePassenger(result);
ResultManager.touch(passengers, "passengers");
} catch (IOException e) {
logger.error("getPassengers error", e);
}
return result;
}
示例6: checkUser
public static String checkUser() {
CloseableHttpClient httpClient = buildHttpClient();
HttpPost httpPost = new HttpPost(UrlConfig.checkUser);
httpPost.addHeader(CookieManager.cookieHeader());
String result = StringUtils.EMPTY;
try(CloseableHttpResponse response = httpClient.execute(httpPost)) {
CookieManager.touch(response);
result = EntityUtils.toString(response.getEntity());
} catch (IOException e) {
logger.error("checkUser error", e);
}
return result;
}
示例7: dateToStr
public static String dateToStr(Date date){
if(date == null){
return StringUtils.EMPTY;
}
DateTime dateTime = new DateTime(date);
return dateTime.toString(STANDARD_FORMAT);
}
示例8: testUpdateErrorStatus
@Test
public void testUpdateErrorStatus() {
final CreateJvmRequest createJvmRequest = new CreateJvmRequest("jvmName", "hostName", 0, 0, 0, 0, 0,
new Path("./jwala.png"), StringUtils.EMPTY, null, null, null, null);
final JpaJvm newJpaJvm = jvmCrudService.createJvm(createJvmRequest, jpaMedia, jpaMedia);
final Identifier<Jvm> jpaJvmId = new Identifier<>(newJpaJvm.getId());
assertEquals(1, jvmCrudService.updateErrorStatus(jpaJvmId, "error!"));
}
示例9: setHeader
@Override
public void setHeader(@Nullable String header)
{
if ((header == null) || header.trim().isEmpty())
{
header = StringUtils.EMPTY;
}
this.header = header;
}
示例10: rootController
@Bean
protected Controller rootController() {
return new ParameterizableViewController() {
@Override
protected ModelAndView handleRequestInternal(final HttpServletRequest request, final HttpServletResponse response)
throws Exception {
final String queryString = request.getQueryString();
final String url = request.getContextPath() + "/login" + (queryString != null ? '?' + queryString : StringUtils.EMPTY);
return new ModelAndView(new RedirectView(response.encodeURL(url)));
}
};
}
示例11: readCallBackUrl
public String readCallBackUrl(final String clientId) {
try {
return jdbcTemplate.queryForObject(CALLBACK_URL_SELECT_STATEMENT, new Object[]{clientId},String.class);
} catch (DataAccessException e) {
e.printStackTrace();
}
return StringUtils.EMPTY;
}
示例12: validatePermissions
private String validatePermissions(Set<Long> permissions) {
for (long permissionID : permissions) {
if (!isPermissionValid(permissionID)) {
return String.format(GroupErrorMessages.PERMISSION_ID_INVALID, permissionID);
}
}
return StringUtils.EMPTY;
}
示例13: invokeFieldGettersMethodToCustomizeString
/**
* 反射调用对象字段的Getters方法,结果定制输出成字符串
* <p>
* 只适用于个别业务场景
*
* @param object
* @param fieldName
* @return 结果定制化
*/
public static String invokeFieldGettersMethodToCustomizeString ( Object object , String fieldName ) {
final Object methodResult = invokeFieldGettersMethod( object , fieldName );
if ( Objects.isNull( methodResult ) ) {
return StringUtils.EMPTY;
}
if ( methodResult.getClass().isEnum() ) {
return invokeFieldGettersMethod( methodResult , "comment" ).toString();
} else if ( methodResult instanceof Date ) {
return DateUtils.formatDateByStyle( ( Date ) methodResult );
}
return methodResult.toString();
}
示例14: getSeatType
public static String getSeatType(String seat) {
for (String st : type) {
String[] arr = st.split(":");
if (StringUtils.equals(arr[0], seat)) {
return arr[1];
}
}
return StringUtils.EMPTY;
}
示例15: X509CredentialsAuthenticationHandler
public X509CredentialsAuthenticationHandler(final Pattern regExTrustedIssuerDnPattern,
final boolean maxPathLengthAllowUnspecified,
final boolean checkKeyUsage,
final boolean requireKeyUsage) {
this(StringUtils.EMPTY, null, null, regExTrustedIssuerDnPattern,
Integer.MAX_VALUE, maxPathLengthAllowUnspecified,
checkKeyUsage, requireKeyUsage, null,
new NoOpRevocationChecker());
}