// Path: app/src/main/java/discovery/contentful/api/CFClient.java
// public class CFClient {
//   private static CDAClient sInstance;
//   private static String locale;
// 
//   private CFClient() {
//   }
// 
//   /**
//    * Initialize this client.
//    *
//    * @param space String representing the Space key.
//    * @param token String representing the access token required to log in to the Space.
//    * @return {@link com.contentful.java.cda.CDAClient} instance.
//    */
//   public synchronized static CDAClient init(String space, String token) {
//     SharedPreferences prefs = CFPrefs.getInstance();
// 
//     prefs.edit()
//         .putString(CFPrefs.KEY_SPACE, space)
//         .putString(CFPrefs.KEY_ACCESS_TOKEN, token)
//         .apply();
// 
//     sInstance = CDAClient.builder().setSpace(space).setToken(token).build();
// 
//     locale = null;
// 
//     return sInstance;
//   }
// 
//   public synchronized static CDAClient getClient() {
//     if (sInstance == null) {
//       SharedPreferences prefs = CFPrefs.getInstance();
// 
//       String space = prefs.getString(CFPrefs.KEY_SPACE, null);
//       String token = prefs.getString(CFPrefs.KEY_ACCESS_TOKEN, null);
// 
//       if (StringUtils.isBlank(space) || StringUtils.isBlank(token)) {
//         throw new IllegalStateException("Uninitialized client.");
//       }
// 
//       return init(space, token);
//     }
// 
//     return sInstance;
//   }
// 
//   /**
//    * Set the locale for this client.
//    *
//    * @param locale String representing the Locale code.
//    */
//   public synchronized static void setLocale(String locale) {
//     CFClient.locale = locale;
//   }
// 
//   /**
//    * Gets the current locale defined for this client.
//    *
//    * @return String representing the current configured locale, null in case the default
//    * locale is being used.
//    */
//   public static String getLocale() {
//     return locale;
//   }
// }


import discovery.contentful.api.CFClient;
import com.contentful.java.cda.CDAAsset;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.ArrayList;
import retrofit.RetrofitError;
package discovery.contentful.loaders;


public class AssetsLoader extends AbsAsyncTaskLoader<ArrayList<CDAAsset>> {
  private static Gson gson;

  public AssetsLoader() {
    super();

    if (gson == null) {
      gson = new GsonBuilder().create();
    }
  }

  @Override protected ArrayList<CDAAsset> performLoad() {
    try {
// Path: app/src/main/java/discovery/contentful/api/CFClient.java
// public class CFClient {
//   private static CDAClient sInstance;
//   private static String locale;
// 
//   private CFClient() {
//   }
// 
//   /**
//    * Initialize this client.
//    *
//    * @param space String representing the Space key.
//    * @param token String representing the access token required to log in to the Space.
//    * @return {@link com.contentful.java.cda.CDAClient} instance.
//    */
//   public synchronized static CDAClient init(String space, String token) {
//     SharedPreferences prefs = CFPrefs.getInstance();
// 
//     prefs.edit()
//         .putString(CFPrefs.KEY_SPACE, space)
//         .putString(CFPrefs.KEY_ACCESS_TOKEN, token)
//         .apply();
// 
//     sInstance = CDAClient.builder().setSpace(space).setToken(token).build();
// 
//     locale = null;
// 
//     return sInstance;
//   }
// 
//   public synchronized static CDAClient getClient() {
//     if (sInstance == null) {
//       SharedPreferences prefs = CFPrefs.getInstance();
// 
//       String space = prefs.getString(CFPrefs.KEY_SPACE, null);
//       String token = prefs.getString(CFPrefs.KEY_ACCESS_TOKEN, null);
// 
//       if (StringUtils.isBlank(space) || StringUtils.isBlank(token)) {
//         throw new IllegalStateException("Uninitialized client.");
//       }
// 
//       return init(space, token);
//     }
// 
//     return sInstance;
//   }
// 
//   /**
//    * Set the locale for this client.
//    *
//    * @param locale String representing the Locale code.
//    */
//   public synchronized static void setLocale(String locale) {
//     CFClient.locale = locale;
//   }
// 
//   /**
//    * Gets the current locale defined for this client.
//    *
//    * @return String representing the current configured locale, null in case the default
//    * locale is being used.
//    */
//   public static String getLocale() {
//     return locale;
//   }
// }


// Path: app/src/main/java/discovery/contentful/loaders/AssetsLoader.java
import discovery.contentful.api.CFClient;
import com.contentful.java.cda.CDAAsset;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.ArrayList;
import retrofit.RetrofitError;

package discovery.contentful.loaders;


public class AssetsLoader extends AbsAsyncTaskLoader<ArrayList<CDAAsset>> {
  private static Gson gson;

  public AssetsLoader() {
    super();

    if (gson == null) {
      gson = new GsonBuilder().create();
    }
  }

  @Override protected ArrayList<CDAAsset> performLoad() {
    try {
      return new ArrayList<>(CFClient.getClient().fetch(CDAAsset.class).all().assets().values());