Class RestRequestHelper
java.lang.Object
de.xima.fc.api.rest.impl.common.util.RestRequestHelper
Helper class for working with requests.
- Since:
- 8.2.0
- Author:
- XIMA MEDIA GmbH
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetContentType(javax.ws.rs.core.MultivaluedMap<String, String> headers) static StringgetFileName(javax.ws.rs.core.MultivaluedMap<String, String> headers) static StringgetHeaderValues(javax.ws.rs.core.MultivaluedMap<String, String> headers, String headerName) static LocalegetLocale(javax.servlet.http.HttpServletRequest servletRequest) static LocalegetLocale(org.pac4j.core.context.WebContext webContext) static List<? extends IScannedFileItem> getUnsafeFileItems(javax.servlet.http.HttpServletRequest servletRequest) Checks the currentMultipartPreservingRequest(if available) for unsafe file uploads
-
Method Details
-
getLocale
-
getContentType
-
getFileName
-
getHeader
public static String getHeader(javax.ws.rs.core.MultivaluedMap<String, String> headers, String headerName) - Parameters:
headers- the map with the available headersheaderName- the field name of the desired header value- Returns:
- If there's exactly one value for the provided header field name, this value will be returned. Otherwise (more than one value or no value at all) null is returned.
-
getHeaderValues
public static List<String> getHeaderValues(javax.ws.rs.core.MultivaluedMap<String, String> headers, String headerName) - Parameters:
headers- the map with the available headersheaderName- the field name of the desired header values- Returns:
- the list of values mapped to the provided header field name (possibly empty but not null)
-
getLocale
-
getUnsafeFileItems
public static List<? extends IScannedFileItem> getUnsafeFileItems(javax.servlet.http.HttpServletRequest servletRequest) Checks the currentMultipartPreservingRequest(if available) for unsafe file uploads- Parameters:
servletRequest- the servlet request to get the desiredMultipartPreservingRequestfrom- Returns:
- a list containing the unsafe file items, possibly empty but never null
-