首页 > 学院 > 开发设计 > 正文

安卓客户端带密码压缩或者解压zip文件

2019-11-06 09:36:40
字体:
来源:转载
供稿:网友
这个是看的别人的文章,然后改过两行,拿到安卓上来用的jar下载地址:http://download.csdn.net/detail/QQ_24179679/9766252操作类如下具体调用 压缩:ZipUtil zipUtil = new ZipUtil();String src = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "DCIM" + File.separator + "aaa";String dest = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "DCIM" + File.separator + "c.zip"; zipUtil.ZipAddPass(src, dest, "jieyamima");解压ZipUtil zipUtil = new ZipUtil();String dest = Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM";File mir = new File(dest);if (mir.exists()) { try {       File[] files = zipUtil.unzip(dest + "/c.zip", dest, "jieyamima");        if (files != null) {                            Log.e("-----------", files.length + "/");                        }                        for (int i = 0; i < files.length; i++) {                            Log.e("-----------", files[i].getAbsolutePath() + "/" + files[i].getName());                        }                    } catch (ZipException e) {                        // TODO Auto-generated catch block                        e.PRintStackTrace();                        Log.e("-------", "解压失败" + e.getMessage());                    }                }else {                    Log.e("-------", "解压失败,DCIM文件夹不存在");                }
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表