本文整理匯總了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());
}