类 UCookies

java.lang.Object
com.gdxsoft.easyweb.utils.UCookies

public class UCookies extends Object
Cookie Utils
  • 字段详细资料

  • 构造器详细资料

    • UCookies

      public UCookies()
      Initialize Class
    • UCookies

      public UCookies(IUSymmetricEncyrpt symmetricEncrypt)
      Initialize Class
      参数:
      symmetricEncrypt - the Encrypt/Decrypt cookie value provider
    • UCookies

      public UCookies(String path, Integer maxAgeSeconds)
      Initialize Class
      参数:
      path - cookie's path
      maxAgeSeconds - cookie's maxAge
    • UCookies

      public UCookies(String path, Integer maxAgeSeconds, IUSymmetricEncyrpt symmeritic)
      Initialize Class
      参数:
      path - cookie's path
      maxAgeSeconds - cookie's maxAge
      symmeritic - the encrypt provider
  • 方法详细资料

    • clearCookies

      public static void clearCookies(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, List<String> skipNames)
      Clear user's browser all cookies
      参数:
      request - HttpServletRequest
      response - HttpServletResponse
      skipNames - skip cookie's names
    • deleteCookie

      public void deleteCookie(String cookieName, javax.servlet.http.HttpServletResponse response)
      Delete the cookie
      参数:
      cookieName - the cookie name
      response - HttpServletResponse
    • addCookie

      public javax.servlet.http.Cookie addCookie(String cookieName, String cookieValue, javax.servlet.http.HttpServletResponse response)
      Add a cookie
      参数:
      cookieName - the cookie name
      cookieValue - the cookie value
      response - HttpServletResponse
      返回:
      Cookie the new cookie
    • encodeCookieValue

      public static String encodeCookieValue(String cookieValue)
      UrlEncode a cookie value (UTF_8)
      参数:
      cookieValue - the cookie plain text
      返回:
      UrlEncode.encoded value
    • decodeCookieValue

      public static String decodeCookieValue(String encoderCookieValue)
      URLDecoder a cookie value (UTF_8)
      参数:
      encoderCookieValue - the UrlEncode.encoded cookie value
      返回:
      URLDecoder.decoded value
    • createCookie

      public javax.servlet.http.Cookie createCookie(String cookieName, String cookieValue)
      create a new cookie
      参数:
      cookieName - the cookie name
      cookieValue - the cookie value
      返回:
      new cookie
    • getDomain

      public String getDomain()
      Cookie's domain
      返回:
      the domain
    • setDomain

      public void setDomain(String domain)
      Cookie's Domain
      参数:
      domain - the domain to set
    • getPath

      public String getPath()
      Cookie's Path
      返回:
      the path
    • setPath

      public void setPath(String path)
      Cookie's Path
      参数:
      path - the path to set
    • getMaxAgeSeconds

      public Integer getMaxAgeSeconds()
      Cookie's MaxAge
      返回:
      the maxAgeSeconds
    • setMaxAgeSeconds

      public void setMaxAgeSeconds(Integer maxAgeSeconds)
      Cookie's MaxAge
      参数:
      maxAgeSeconds - the maxAgeSeconds to set
    • isHttpOnly

      public boolean isHttpOnly()
      Cookie's httpOnly
      返回:
      the httpOnly
    • setHttpOnly

      public void setHttpOnly(boolean httpOnly)
      Cookie's httpOnly
      参数:
      httpOnly - the httpOnly to set
    • isSecret

      public boolean isSecret()
      Cookie's secure
      返回:
      the secert
    • setSecret

      public void setSecret(boolean secret)
      Cookie's secure
      参数:
      secret - the secert to set
    • isEncrypt

      public boolean isEncrypt()
      Encrypt cookie value, using setSymmetricEncrypt
      返回:
      the ewaDes
    • getSymmetricEncrypt

      public IUSymmetricEncyrpt getSymmetricEncrypt()
      Encrypt/ Decrypt Cookie value algorithm(AES/DES ...)
      返回:
      the symmetric encrypt algorithm(AES/DES ...)
    • setSymmetricEncrypt

      public void setSymmetricEncrypt(IUSymmetricEncyrpt symmetricEncrypt)
      Set Encrypt/ Decrypt cookie value algorithm(AES/DES ...)
      参数:
      symmetricEncrypt - algorithm(AES/DES ...)