com.android.sdklib.internal.repository
Enum DownloadCache.Strategy

java.lang.Object
  extended by java.lang.Enum<DownloadCache.Strategy>
      extended by com.android.sdklib.internal.repository.DownloadCache.Strategy
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<DownloadCache.Strategy>
Enclosing class:
DownloadCache

public static enum DownloadCache.Strategy
extends java.lang.Enum<DownloadCache.Strategy>


Enum Constant Summary
DIRECT
          Disables caching.
FRESH_CACHE
          If the files are available in the cache, check if there's an update (either using an e-tag check or comparing to the default time expiration).
ONLY_CACHE
          Exclusively serves data from the cache.
SERVE_CACHE
          If the files are available in the cache, serve them as-is, otherwise download them and return the cached version.
 
Method Summary
static DownloadCache.Strategy valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static DownloadCache.Strategy[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ONLY_CACHE

public static final DownloadCache.Strategy ONLY_CACHE
Exclusively serves data from the cache. If files are available in the cache, serve them as is (without trying to refresh them). If files are not available, they are not fetched at all.


SERVE_CACHE

public static final DownloadCache.Strategy SERVE_CACHE
If the files are available in the cache, serve them as-is, otherwise download them and return the cached version. No expiration or refresh is attempted if a file is in the cache.


FRESH_CACHE

public static final DownloadCache.Strategy FRESH_CACHE
If the files are available in the cache, check if there's an update (either using an e-tag check or comparing to the default time expiration). If files have expired or are not in the cache then download them and return the cached version.


DIRECT

public static final DownloadCache.Strategy DIRECT
Disables caching. URLs are always downloaded and returned directly. Downloaded streams aren't cached locally.

Method Detail

values

public static DownloadCache.Strategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (DownloadCache.Strategy c : DownloadCache.Strategy.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static DownloadCache.Strategy valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null