@RestContentHeader("Content-Disposition") public String getContentDisposition() { return _disposition; } }
private Map<String, Object> getResponseHeaders(final Object content) { Map<String, Object> headers = Collections.emptyMap(); if (content instanceof CustomRestHeaders) { CustomRestHeaders customRestHeaders = (CustomRestHeaders) content; Map<RestContentHeader, Method> contentHeaderGetters = getContentHeaderMethods(customRestHeaders); if (contentHeaderGetters != null) { headers = new HashMap<>(); for (Map.Entry<RestContentHeader, Method> entry : contentHeaderGetters.entrySet()) { final String headerName = entry.getKey().value(); try { final Object headerValue = entry.getValue().invoke(customRestHeaders); if (headerValue != null) { headers.put(headerName.toUpperCase(), headerValue); } } catch (Exception e) { LOGGER.warn("Unexpected exception whilst setting response header " + headerName, e); } } } } return headers; }
@RestContentHeader("Content-Type") public String getContentType() { return "text/plain"; }
@RestContentHeader("Content-Type") public String getContentType() { return _contentType; }
@RestContentHeader("Content-Type") public String getContentType() { return "text/plain;charset=utf-8"; } }
@RestContentHeader("Content-Type") public String getContentType() { return "application/octet-stream"; }
@RestContentHeader("Content-Disposition") public String getContentDisposition() { return _disposition; }
@RestContentHeader("Content-Type") public String getContentType() { return "application/x-zip"; }
@RestContentHeader("Content-Disposition") public String getContentDisposition() { return _disposition; }
@RestContentHeader("Content-Disposition") public String getContentDisposition() { return _disposition; }
@RestContentHeader("Content-Type") public String getContentType() { return "text/plain"; }
@RestContentHeader("Content-Disposition") public String getContentDisposition() { return String.format("attachment; filename=\"%s-%s.acl\"", _name, FORMATTER.format(LocalDateTime.now())); }