Class ContentSettings

java.lang.Object
com.oracle.content.sdk.ContentSettings

public class ContentSettings extends Object
For finer control over the SDK settings, such as enabling the cache or changing the connection timeout.
  • Constructor Details

    • ContentSettings

      public ContentSettings()
      Construct general settings, using defaults (no cache, default timeout)
  • Method Details

    • enableCache

      public ContentSettings enableCache(File cacheDir)
      Enable the cache using the specified folder for the cache. This will enable the both http and asset caches and use all defaults. For more specific cache settings, use setCacheSettings(CacheSettings)
      Parameters:
      cacheDir - folder to use for cache data
      Returns:
      this
    • setUserAgentHeader

      public ContentSettings setUserAgentHeader(String userAgentHeader)
      Set the "User-Agent" header to be sent with each SDK request.
      Parameters:
      userAgentHeader - User-Agent header value
      Returns:
      this
    • setCacheSettings

      public ContentSettings setCacheSettings(CacheSettings settings)
      Set more specific set of cache settings. See CacheSettings
      Parameters:
      settings - Cache settings
      Returns:
      this
    • setTimeoutSeconds

      public ContentSettings setTimeoutSeconds(int connectionTimeoutSeconds)
    • getConnectionTimeoutSeconds

      public Integer getConnectionTimeoutSeconds()
    • getCacheSettings

      public CacheSettings getCacheSettings()
    • getUserAgentHeader

      public String getUserAgentHeader()