Class ResponseHeaderService

java.lang.Object
sk.iway.iwcm.components.response_header.rest.ResponseHeaderService

@Service public class ResponseHeaderService extends Object
  • Constructor Details

    • ResponseHeaderService

      public ResponseHeaderService()
  • Method Details

    • getResponseHeaders

      public Map<String,ResponseHeaderEntity> getResponseHeaders(String url)
    • deleteDomainCache

      public static void deleteDomainCache()
    • setResponseHeaders

      public static void setResponseHeaders(String path, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Set HTTP headers for path
    • setContentLanguageHeader

      public static void setContentLanguageHeader(String lngContryPair, boolean forceSet, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Set Content-Language header, also set response.setLocale
      Parameters:
      lngContryPair - - pair eg sk-SK, cs-CZ, en-GB
      forceSet - - set to true to owerwrite previously set value
      request -
      response -
    • isPathCorrect

      public static boolean isPathCorrect(String path, String url)
      Check if path is correct for URL, it accepts path in format - /path/subpath/ - use startsWith - /path/subpath/*.pdf - use startsWith for /path/subpath/ and endsWith for *.pdf - /path/subpath/*.pdf,*.jpg - use startsWith for /path/subpath/ and endsWith for *.pdf or *.jpg - ^/path/subpath/$ - use equals
      Parameters:
      path - - path to test
      url - - URL address to test
      Returns: