public String getSuffix() { return requestPathInfo.getSuffix(); }
/** * Get the entire suffix. * * @param request * @return Returns null if Request's pathInfo or Suffix is null */ public static String getSuffix(final SlingHttpServletRequest request) { RequestPathInfo pathInfo = request.getRequestPathInfo(); if (pathInfo == null || pathInfo.getSuffix() == null) { return null; } return pathInfo.getSuffix(); }
/** * Get the entire suffix. * * @param request * @return Returns null if Request's pathInfo or Suffix is null */ public static String getSuffix(final SlingHttpServletRequest request) { RequestPathInfo pathInfo = request.getRequestPathInfo(); if (pathInfo == null || pathInfo.getSuffix() == null) { return null; } return pathInfo.getSuffix(); }
/** * Gets the suffixes as an array; each segment is the text between the /'s. * * /segment-0/segment-1/segment-2 * * @param request * @return and array of the suffix segments or empty array */ public static String[] getSuffixSegments(final SlingHttpServletRequest request) { RequestPathInfo pathInfo = request.getRequestPathInfo(); if (pathInfo == null || pathInfo.getSuffix() == null) { return new String[] {}; } return StringUtils.split(pathInfo.getSuffix(), '/'); }
/** * Gets the suffixes as an array; each segment is the text between the /'s. * * /segment-0/segment-1/segment-2 * * @param request * @return and array of the suffix segments or empty array */ public static String[] getSuffixSegments(final SlingHttpServletRequest request) { RequestPathInfo pathInfo = request.getRequestPathInfo(); if (pathInfo == null || pathInfo.getSuffix() == null) { return new String[] {}; } return StringUtils.split(pathInfo.getSuffix(), '/'); }
@Override public String getSuffix() { return isSuffixOverridden ? suffix : getOriginal().getSuffix(); }
@Override public String getSuffix() { return isSuffixOverridden ? suffix : getOriginal().getSuffix(); }
protected boolean checkSuffix(RequestPathInfo pathInfo, ValueMap properties) { return check(pathInfo.getSuffix(), PN_ALLOWED_SUFFIXES, PN_ALLOWED_SUFFIX_PATTERN, properties); }
@Override protected String getContentType(Resource resource, SlingHttpServletRequest request) { // get filename from suffix to get extension String fileName = request.getRequestPathInfo().getSuffix(); if (StringUtils.isNotEmpty(fileName)) { // if extension is PNG use PNG content type, otherwise fallback to JPEG String fileExtension = StringUtils.substringAfterLast(fileName, "."); if (StringUtils.equalsIgnoreCase(fileExtension, FileExtension.PNG)) { return ContentType.PNG; } } // for rendered images use JPEG mime type as default fallback return ContentType.JPEG; }
/** * Current content path * @param request Request * @return Current content path or null */ private static String getContentPath(HttpServletRequest request) { String contentPath = (String)request.getAttribute(Value.CONTENTPATH_ATTRIBUTE); if (contentPath == null) { // fallback to suffix if CONTENTPATH_ATTRIBUTE is not set // (e.g. in inside a /libs/granite/ui/components/foundation/form/multifield component) contentPath = ((SlingHttpServletRequest)request).getRequestPathInfo().getSuffix(); } return contentPath; }
protected boolean checkSuffix(RequestPathInfo pathInfo, ValueMap properties) { return check(pathInfo.getSuffix(), PN_ALLOWED_SUFFIXES, PN_ALLOWED_SUFFIX_PATTERN, properties); }
private static String getResourceTypeFromSuffix(SlingHttpServletRequest request) { final String suffix = request.getRequestPathInfo().getSuffix(); return StringUtils.removeStart(suffix, "/"); } }
private static String getResourceTypeFromSuffix(SlingHttpServletRequest request) { final String suffix = request.getRequestPathInfo().getSuffix(); return StringUtils.removeStart(suffix, "/"); }
public static Map<String, String> addPath(final SlingHttpServletRequest request, Map<String, String> map) { if (has(request, CF_PATH)) { map = put(request, map, CF_PATH, GROUP_PATH, true); } else { map.put(CF_PATH, request.getRequestPathInfo().getSuffix()); } return map; }
public static Map<String, String> addPath(final SlingHttpServletRequest request, Map<String, String> map) { if (has(request, CF_PATH)) { map = put(request, map, CF_PATH, GROUP_PATH, true); } else { map.put(CF_PATH, request.getRequestPathInfo().getSuffix()); } return map; }
@Inject public ExecutionModel(@OSGiService History history, SlingHttpServletRequest request) { entry = history.find(request.getRequestPathInfo().getSuffix()); }
@Override public Object getAttribute(String name) { if (INCLUDE_REQUEST_URI_ATTRIBUTE.equals(name)) { return getServletPath() + getRequestPathInfo().getSuffix(); } if (INCLUDE_SERVLET_PATH_ATTRIBUTE.equals(name)) { return getServletPath(); } return super.getAttribute(name); }
@Inject public ExecutionModel(@OSGiService History history, SlingHttpServletRequest request) { entry = history.find(request.getRequestPathInfo().getSuffix()); }
@Override public final boolean hasValidSuffix(final SlingHttpServletRequest slingRequest) { final String requestSuffix = slingRequest.getRequestPathInfo().getSuffix(); if (StringUtils.equals(requestSuffix, this.getSuffix()) || StringUtils.startsWith(requestSuffix, this.getSuffix() + "/")) { return true; } return false; }
@Override public final boolean hasValidSuffix(final SlingHttpServletRequest slingRequest) { final String requestSuffix = slingRequest.getRequestPathInfo().getSuffix(); if (StringUtils.equals(requestSuffix, this.getSuffix()) || StringUtils.startsWith(requestSuffix, this.getSuffix() + "/")) { return true; } return false; }