// Path: app/src/main/java/io/github/emanual/app/entity/BookJSONEntity.java
// public class BookJSONEntity extends BaseEntity implements Serializable {
//     private String title;
//     private BookInfoEntity info;
// 
//     public BookInfoEntity getInfo() {
//         return info;
//     }
// 
//     public void setInfo(BookInfoEntity info) {
//         this.info = info;
//     }
// 
//     public String getTitle() {
//         return title;
//     }
// 
//     public void setTitle(String title) {
//         this.title = title;
//     }
// }


import android.content.Context;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import io.github.emanual.app.entity.BookJSONEntity;
package io.github.emanual.app.utils;




/**
 * Author: jayin
 * Date: 1/23/16
 */
public class BookResource {
    /**
     * 获取所有books/* 所有文件名(英文书名)列表
     * @param context
     * @return
     */
    public static List<String> getBookNameList(Context context) {
        List<String> books = new ArrayList<>();
        File bookDir = new File(AppPath.getBooksPath(context));
        if (!bookDir.exists()) {
            bookDir.mkdirs();
        }
        books.addAll(Arrays.asList(bookDir.list()));
        return books;
    }

    /**
     * 获取所有books/<bookName>/book/book.json
     * @param context
     * @return
     */
// Path: app/src/main/java/io/github/emanual/app/entity/BookJSONEntity.java
// public class BookJSONEntity extends BaseEntity implements Serializable {
//     private String title;
//     private BookInfoEntity info;
// 
//     public BookInfoEntity getInfo() {
//         return info;
//     }
// 
//     public void setInfo(BookInfoEntity info) {
//         this.info = info;
//     }
// 
//     public String getTitle() {
//         return title;
//     }
// 
//     public void setTitle(String title) {
//         this.title = title;
//     }
// }


// Path: app/src/main/java/io/github/emanual/app/utils/BookResource.java
import android.content.Context;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import io.github.emanual.app.entity.BookJSONEntity;

package io.github.emanual.app.utils;




/**
 * Author: jayin
 * Date: 1/23/16
 */
public class BookResource {
    /**
     * 获取所有books/* 所有文件名(英文书名)列表
     * @param context
     * @return
     */
    public static List<String> getBookNameList(Context context) {
        List<String> books = new ArrayList<>();
        File bookDir = new File(AppPath.getBooksPath(context));
        if (!bookDir.exists()) {
            bookDir.mkdirs();
        }
        books.addAll(Arrays.asList(bookDir.list()));
        return books;
    }

    /**
     * 获取所有books/<bookName>/book/book.json
     * @param context
     * @return
     */
    public static List<BookJSONEntity> getBookJSONList(Context context) {