当前位置: 首页>>代码示例>>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;未经允许,请勿转载。