AssetUtil.java 文件源码

java
阅读 46 收藏 0 点赞 0 评论 0

项目:javaide 作者:
public static boolean copyAssetFolder(AssetManager assetManager,
                                      String fromAssetPath, String toPath) {
    try {
        String[] files = assetManager.list(fromAssetPath);
        new File(toPath).mkdirs();
        boolean res = true;
        for (String file : files)
            if (file.contains(".")) {
                res &= copyAsset(assetManager,
                        fromAssetPath + "/" + file,
                        toPath + "/" + file);
            } else {
                res &= copyAssetFolder(assetManager,
                        fromAssetPath + "/" + file,
                        toPath + "/" + file);
            }
        return res;
    } catch (Exception e) {
        e.printStackTrace();
        return false;
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号