Class CSAppUtils

java.lang.Object
com.contentstack.sdk.utility.CSAppUtils

public class CSAppUtils
extends Object
Utilities for contentstack
  • Constructor Details

  • Method Details

    • getResponseTimeFromCacheFile

      public boolean getResponseTimeFromCacheFile​(File file, long time)
      To check if required response within given time window available in cache
      Parameters:
      file - cache file.
      time - time
      Returns:
      true if cache data available which satisfy given time condition.
    • getJsonFromCacheFile

      public static org.json.JSONObject getJsonFromCacheFile​(File file)
      To retrieve data from cache.
      Parameters:
      file - cache file.
      Returns:
      cache data in JSON.
    • getMD5FromString

      public String getMD5FromString​(String value)
      To encrypt given value.
      Parameters:
      value - string
      Returns:
      MD5 value
    • parseDate

      public static Calendar parseDate​(String date, String dateFormat, TimeZone timeZone) throws ParseException
      Converts the given date to the user's timezone.
      Parameters:
      date - String
      dateFormat - String
      timeZone - String
      Returns:
      Calendar
      Throws:
      ParseException -

      Example :
              CSAppUtils.parseDate(dateString, "yyyy-MM-dd'T'HH:mm:ssZ", TimeZone.getTimeZone("GMT"));