本文整理汇总了Java中org.apache.commons.collections.EnumerationUtils类的典型用法代码示例。如果您正苦于以下问题:Java EnumerationUtils类的具体用法?Java EnumerationUtils怎么用?Java EnumerationUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EnumerationUtils类属于org.apache.commons.collections包,在下文中一共展示了EnumerationUtils类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getAliases
import org.apache.commons.collections.EnumerationUtils; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static List<String> getAliases() {
LOGGER.entering(KeyStoreTool.class.getName(), "getAliases");
List<String> result = new LinkedList<String>();
try {
result.addAll(EnumerationUtils.toList(keyStore.aliases()));
} catch (Exception e) {
LOGGER.log(Level.WARNING, "Error while reading aliases.", e);
}
LOGGER.exiting(KeyStoreTool.class.getName(), "getAliases", result);
return result;
}
开发者ID:vetsin,项目名称:SamlSnort,代码行数:17,代码来源:KeyStoreTool.java
示例2: filter
import org.apache.commons.collections.EnumerationUtils; //导入依赖的package包/类
/**
* Filter {@link JarEntry} list from {@link JarFile}
*
* @param jarFile
* {@link JarFile}
* @param jarEntryFilter
* {@link JarEntryFilter}
* @return Read-only List
*/
@Nonnull
public static List<JarEntry> filter(JarFile jarFile, JarEntryFilter jarEntryFilter) {
if (jarFile == null) {
return Collections.emptyList();
}
Enumeration<JarEntry> jarEntries = jarFile.entries();
List<JarEntry> jarEntriesList = EnumerationUtils.toList(jarEntries);
return doFilter(jarEntriesList, jarEntryFilter);
}
开发者ID:mercyblitz,项目名称:confucius-commons,代码行数:19,代码来源:JarUtils.java
示例3: getCXFServletConfig
import org.apache.commons.collections.EnumerationUtils; //导入依赖的package包/类
/**
* This is a workaround after upgrading to CXF 2.7.0 whereby we could no longer just call "setHideServiceList" on
* the ServletController. Instead, it is now reading this information from the ServletConfig, so wrapping the base
* ServletContext to return true or false for hide service list depending on whether or not we are in dev mode.
*/
protected ServletConfig getCXFServletConfig(final ServletConfig baseServletConfig) {
// disable handling of URLs ending in /services which display CXF generated service lists if we are not in dev mode
final String shouldHide = Boolean.toString(!ConfigContext.getCurrentContextConfig().getDevMode().booleanValue());
return new ServletConfig() {
private static final String HIDE_SERVICE_LIST_PAGE_PARAM = "hide-service-list-page";
@Override
public String getServletName() {
return baseServletConfig.getServletName();
}
@Override
public ServletContext getServletContext() {
return baseServletConfig.getServletContext();
}
@Override
public String getInitParameter(String parameter) {
if (HIDE_SERVICE_LIST_PAGE_PARAM.equals(parameter)) {
return shouldHide;
}
return baseServletConfig.getInitParameter(parameter);
}
@Override
public Enumeration<String> getInitParameterNames() {
List<String> initParameterNames = EnumerationUtils.toList(baseServletConfig.getInitParameterNames());
initParameterNames.add(HIDE_SERVICE_LIST_PAGE_PARAM);
return new Vector<String>(initParameterNames).elements();
}
};
}
开发者ID:kuali,项目名称:kc-rice,代码行数:34,代码来源:KSBDispatcherServlet.java
示例4: read
import org.apache.commons.collections.EnumerationUtils; //导入依赖的package包/类
@Read
public Patient read(@IdParam IdDt theId, HttpServletRequest theRequest) {
Patient retVal = new Patient();
retVal.setId(theId);
ourRequest = theRequest;
ourLog.info(EnumerationUtils.toList(ourRequest.getHeaderNames()).toString());
ourLog.info("Proxy-Connection: " + EnumerationUtils.toList(ourRequest.getHeaders("Proxy-Connection")));
ourLog.info("Host: " + EnumerationUtils.toList(ourRequest.getHeaders("Host")));
ourLog.info("User-Agent: " + EnumerationUtils.toList(ourRequest.getHeaders("User-Agent")));
return retVal;
}
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:14,代码来源:HttpProxyTest.java
示例5: read
import org.apache.commons.collections.EnumerationUtils; //导入依赖的package包/类
@Read
public Patient read(@IdParam IdType theId, HttpServletRequest theRequest) {
Patient retVal = new Patient();
retVal.setId(theId);
ourRequest = theRequest;
ourLog.info(EnumerationUtils.toList(ourRequest.getHeaderNames()).toString());
ourLog.info("Proxy-Connection: " + EnumerationUtils.toList(ourRequest.getHeaders("Proxy-Connection")));
ourLog.info("Host: " + EnumerationUtils.toList(ourRequest.getHeaders("Host")));
ourLog.info("User-Agent: " + EnumerationUtils.toList(ourRequest.getHeaders("User-Agent")));
return retVal;
}
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:14,代码来源:HttpProxyTest.java
示例6: extractHeaders
import org.apache.commons.collections.EnumerationUtils; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static List<Pair<String, String>> extractHeaders(HttpServletRequest httpServletRequest) {
List<Pair<String, String>> result = new ArrayList<>();
for (String headerName : (List<String>) EnumerationUtils.toList(httpServletRequest.getHeaderNames())) {
result.add(Pair.of(headerName, httpServletRequest.getHeader(headerName)));
}
return result;
}
开发者ID:koen-serneels,项目名称:ws-proxy,代码行数:10,代码来源:HttpRequestHeaderTransfererInterceptor.java
示例7: getAliases
import org.apache.commons.collections.EnumerationUtils; //导入依赖的package包/类
/**
* Gets all aliases in the {@link KeyStore}.
*/
@SuppressWarnings(UNCHECKED)
public Collection<String> getAliases() {
try {
return EnumerationUtils.toList(crypto.getKeyStore().aliases());
} catch (KeyStoreException e) {
// no way to recover
throw new RuntimeException(e);
}
}
开发者ID:barnyard,项目名称:pi,代码行数:13,代码来源:CryptoFacade.java
示例8: doGet
import org.apache.commons.collections.EnumerationUtils; //导入依赖的package包/类
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
resp.setContentType("text/html");
ServletOutputStream out = resp.getOutputStream();
List<String> list = EnumerationUtils.toList(req.getHeaderNames());
for (String key : list)
{
out.print(String.format("%s = %s <br>", key, req.getHeader(key)));
}
out.flush();
}
开发者ID:approvals,项目名称:ApprovalTests.Java,代码行数:13,代码来源:ReportEnvironmentServer.java
示例9: getAttributeKeys
import org.apache.commons.collections.EnumerationUtils; //导入依赖的package包/类
@SuppressWarnings({ "unchecked" })
@Override
public Collection<Object> getAttributeKeys() throws InvalidSessionException {
return EnumerationUtils.toList( request.getAttributeNames() );
}
开发者ID:apache,项目名称:usergrid,代码行数:6,代码来源:HttpServletRequestSession.java
示例10: getResources
import org.apache.commons.collections.EnumerationUtils; //导入依赖的package包/类
/**
* Get the resource URLs Set under specified resource name and type
*
* @param classLoader
* ClassLoader
* @param resourceType
* {@link ResourceType} Enum
* @param resourceName
* resource name ,e.g : <br /> <ul> <li>Resource Name :<code>"/com/abc/def.log"</code></li> <li>Class Name :
* <code>"java.lang.String"</code></li> </ul>
* @return the resource URL under specified resource name and type
* @throws NullPointerException
* If any argument is <code>null</code>
* @throws IOException
* @version 1.0.0
* @since 1.0.0
*/
public static Set<URL> getResources(ClassLoader classLoader, ResourceType resourceType, String resourceName) throws NullPointerException, IOException {
String normalizedResourceName = resourceType.resolve(resourceName);
Enumeration<URL> resources = classLoader.getResources(normalizedResourceName);
return resources != null && resources.hasMoreElements() ? Sets.newLinkedHashSet(EnumerationUtils.toList(resources)) : Collections.<URL>emptySet();
}
开发者ID:mercyblitz,项目名称:confucius-commons,代码行数:23,代码来源:ClassLoaderUtils.java
注:本文中的org.apache.commons.collections.EnumerationUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论