Hola a todos,
 
Tengo el siguiente código para descomprimir archivos:
 
public void descomprimirArchivo() {
		String path;
		boolean error = false;
		int fichProcesados = 0;
		int fichTotal = 0;
 
		path = txtRuta.getText();
		File dir = new File(path);
		String[] ficheros = dir.list();
		if (ficheros.length == 0){
			JOptionPane.showMessageDialog(null,"No hay ficheros en el directorio especificado","Aviso", JOptionPane.ERROR_MESSAGE);
		}
		else{
			fichTotal = ficheros.length;
			for (int i=0;i<ficheros.length;i++){
				try{
					//crear un ZipInputStream para leer el fichero zip
					FileInputStream fis = new FileInputStream(path + File.separator + ficheros[i]);
					ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis));
					ZipEntry entry;
					//crear un bucle para recorrer todos los archivos del zip
					while((entry = zis.getNextEntry()) != null){
						File file = new File(dir.getAbsolutePath() + File.separator + entry.getName());
						ZipFile zipFile = new ZipFile(path + File.separator + ficheros[i]);
						if(!entry.isDirectory()){
							BufferedInputStream bis = new BufferedInputStream(zipFile.getInputStream(entry),  BUFFER_SIZE);
							String parentName;
							if((parentName = file.getParent()) != null){
								File dire = new File(parentName);
								//File dire = new File(ficheros[i] + parentName);
								dire.mkdirs();
							}
							BufferedOutputStream dest = new BufferedOutputStream(new FileOutputStream(file), BUFFER_SIZE);
							int cont;
							while((cont = bis.read()) != -1){
								dest.write(cont);
							}
							bis.close();
							dest.close();
						}
						else{
							file.mkdirs();
						}
						entry = zis.getNextEntry();	
					}
					zis.close();
					fichProcesados ++;
				}
				catch(Exception exc){
					error = true;
					exc.printStackTrace();
				}
			}
			if (error = false){
				JOptionPane.showMessageDialog(null,"Los ficheros se han extraído con éxito", "Aviso",JOptionPane.ERROR_MESSAGE);
			}
			else{
				JOptionPane.showMessageDialog(null,"Se han extraído " + fichProcesados + " ficheros de los " + fichTotal + ".", "Aviso",JOptionPane.INFORMATION_MESSAGE);
			}
		}
 
	}
 
Lo que quiero es que la primera carpeta que se me cree sea una que tenga el nombre del zip, y que en ella se me construya toda la estructura de carpetas (o archivos). Porque lo que tengo que descomprimir son zip´s, que contienen la misma estructura pero que se llaman diferente.
No sé si me he explicado bien.... 
muchas gracias y un saludo! 
  
 
