/* * File: fileDialog.java * This file is part of Tico, an application to create and perform * interactive communication boards to be used by people with * severe motor disabilities. * * Author: Eduardo Ferrer * * Date: Nov, 2011 * * Company: Universidad de Zaragoza, CPS, DIIS * * License: * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, either version 3 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ package android.TICO; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Enumeration; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; /** * The class that manage the files unzip when we load a project in a temp folder * and the deleting of the temp files */ public class readProject { private final static int ZIP_BUFFER_SIZE = 8192;//2048; // Unzips a file to a directory public static void loadZip(File zipFile,File tempDirectory) throws IOException { unzip(zipFile, tempDirectory); } public static void borrarTmp(File fich){ if(fich.isDirectory()){ File[] contenido= fich.listFiles(); for(int i=0;i= 0) out.write(buffer, 0, bytes); // Close input and output streams in.close(); out.close(); } // Close the zip file zipFile.close(); } }