List of usage examples for java.util Collections enumeration
public static <T> Enumeration<T> enumeration(final Collection<T> c)
From source file:by.creepid.jsf.fileupload.UploadFilter.java
private static HttpServletRequest wrapRequest(HttpServletRequest request, final Map<String, String[]> parameterMap) { /**// w w w.j av a 2 s . com * Provides a convenient implementation of the HttpServletRequest * interface that can be subclassed by developers wishing to adapt the * request to a Servlet */ return new HttpServletRequestWrapper(request) { // inner methods passed as parameters @Override public Map<String, String[]> getParameterMap() { return parameterMap; } @Override public String[] getParameterValues(String name) { return (String[]) parameterMap.get(name); } @Override public String getParameter(String name) { String[] params = getParameterValues(name); if (params == null) { return null; } return params[0]; } @Override public Enumeration<String> getParameterNames() { return Collections.enumeration(parameterMap.keySet()); } }; }
From source file:de.micromata.genome.gwiki.page.impl.actionbean.CommonMultipartRequest.java
@SuppressWarnings({ "rawtypes", "unchecked" }) public Enumeration getParameterNames() { Set paramNames = new HashSet(); Enumeration paramEnum = getRequest().getParameterNames(); while (paramEnum.hasMoreElements()) { paramNames.add(paramEnum.nextElement()); }/*www.j av a 2 s . c om*/ paramNames.addAll(this.multipartParams.keySet()); return Collections.enumeration(paramNames); }
From source file:fr.paris.lutece.portal.web.upload.MultipartHttpServletRequest.java
/** * Gets parameters names//from w w w .j a va 2s .co m * @return An enumeration of parameters names */ public Enumeration getParameterNames() { return Collections.enumeration(_stringParameters.keySet()); }
From source file:be.fedict.eid.dss.model.bean.ServicesManagerBean.java
public List<String> getSupportedDocumentFormats() { Set<String> documentFormats = this.servicesManagerSingleton.getSupportedDocumentFormats(); return Collections.list(Collections.enumeration(documentFormats)); }
From source file:com.gisgraphy.webapp.filter.LocaleRequestWrapper.java
/** * {@inheritDoc}/*from ww w . j ava2 s . c o m*/ */ @Override @SuppressWarnings("unchecked") public Enumeration<Locale> getLocales() { if (null != preferredLocale) { List<Locale> l = Collections.list(super.getLocales()); if (l.contains(preferredLocale)) { l.remove(preferredLocale); } l.add(0, preferredLocale); return Collections.enumeration(l); } else { return super.getLocales(); } }
From source file:com.wxxr.nirvana.json.StrutsMockHttpServletRequest.java
public Enumeration getParameterNames() { return Collections.enumeration(parameterMap.keySet()); }
From source file:Main.java
@Override public Enumeration<Node> children() { return Collections.enumeration(children); }
From source file:cloudlens.parser.FileReader.java
public static InputStream readFiles(String[] fileNames) throws IOException { try {//w w w . jav a 2s . co m final List<InputStream> streams = new ArrayList<>(); for (final String name : fileNames) { streams.add(new FileInputStream(new File(name))); } final Enumeration<InputStream> files = Collections.enumeration(streams); return new SequenceInputStream(files); } catch (final IOException e) { throw new CLException(e.getMessage()); } }
From source file:org.wso2.carbon.identity.auth.service.AuthenticationRequest.java
public Enumeration<String> getHeaders(String name) { String headerValue = headers.get(name); if (headerValue != null) { String[] multiValuedHeader = headerValue.split(","); return Collections.enumeration(Arrays.asList(multiValuedHeader)); } else {//from w w w. j a va2 s .com return Collections.emptyEnumeration(); } }
From source file:com.liferay.portal.template.velocity.internal.FastExtendedProperties.java
@Override @SuppressWarnings("rawtypes") public Enumeration keys() { return Collections.enumeration(_map.keySet()); }