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


Java StringUtils.EMPTY屬性代碼示例

本文整理匯總了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;
}
 
開發者ID:justice-code,項目名稱:Thrush,代碼行數:18,代碼來源:HttpRequest.java

示例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;
}
 
開發者ID:tosinoni,項目名稱:SECP,代碼行數:17,代碼來源:AdminController.java

示例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;
}
 
開發者ID:cmanda,項目名稱:axway-b2b-plugins,代碼行數:19,代碼來源:AzureTransportUtility.java

示例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);
}
 
開發者ID:cerner,項目名稱:jwala,代碼行數:16,代碼來源:AbstractGroupPersistenceServiceIntegrationTest.java

示例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;
}
 
開發者ID:justice-code,項目名稱:Thrush,代碼行數:17,代碼來源:HttpRequest.java

示例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;
}
 
開發者ID:justice-code,項目名稱:Thrush,代碼行數:16,代碼來源:HttpRequest.java

示例7: dateToStr

public static String dateToStr(Date date){
    if(date == null){
        return StringUtils.EMPTY;
    }
    DateTime dateTime = new DateTime(date);
    return dateTime.toString(STANDARD_FORMAT);
}
 
開發者ID:Liweimin0512,項目名稱:MMall_JAVA,代碼行數:7,代碼來源:DateTimeUtil.java

示例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!"));
}
 
開發者ID:cerner,項目名稱:jwala,代碼行數:8,代碼來源:JvmCrudServiceImplTest.java

示例9: setHeader

@Override
public void setHeader(@Nullable String header)
{
    if ((header == null) || header.trim().isEmpty())
    {
        header = StringUtils.EMPTY;
    }
    this.header = header;
}
 
開發者ID:GotoFinal,項目名稱:diorite-configs-java8,代碼行數:9,代碼來源:DocumentCommentsImpl.java

示例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)));
        }
    };
}
 
開發者ID:mrluo735,項目名稱:cas-5.1.0,代碼行數:12,代碼來源:CasApplicationContextConfiguration.java

示例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;
}
 
開發者ID:xienjiang,項目名稱:session-cloud,代碼行數:9,代碼來源:CustomTokenStore.java

示例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;
}
 
開發者ID:tosinoni,項目名稱:SECP,代碼行數:9,代碼來源:GroupController.java

示例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();
}
 
開發者ID:yujunhao8831,項目名稱:spring-boot-start-current,代碼行數:21,代碼來源:ReflectionProUtils.java

示例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;
}
 
開發者ID:justice-code,項目名稱:Thrush,代碼行數:9,代碼來源:SeatConfig.java

示例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());
}
 
開發者ID:mrluo735,項目名稱:cas-5.1.0,代碼行數:9,代碼來源:X509CredentialsAuthenticationHandler.java


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