Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void unzip(File zipFile, File targetDirectory) throws IOException {
- ZipInputStream zis = new ZipInputStream(
- new BufferedInputStream(new FileInputStream(zipFile)));
- try {
- ZipEntry ze;
- int count;
- byte[] buffer = new byte[8192];
- while ((ze = zis.getNextEntry()) != null) {
- File file = new File(targetDirectory, ze.getName());
- File dir = ze.isDirectory() ? file : file.getParentFile();
- } finally {
- zis.close();
- }
- }
- File file = new File(context.getFilesDir() + "/ACPLUS.ZIP");
- File targetDir = new File(context.getFilesDir() + "/DATA");
- if (!targetDir.exists()) {
- targetDir.mkdirs();
- }
- if(file.exists()) {
- try {
- ZIPHandler.unzip(file, targetDir);
- }
- catch (IOException e) {
- e.printStackTrace();
- }
- }
- while ((ze = zis.getNextEntry()) != null) {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement