Ver Mensaje Individual
  #3 (permalink)  
Antiguo 04/05/2010, 19:58
Avatar de rocka8613
rocka8613
 
Fecha de Ingreso: abril-2010
Mensajes: 33
Antigüedad: 14 años
Puntos: 0
Respuesta: Visualizar archivos zip con java

Cita:
Iniciado por chuidiang Ver Mensaje
[url]http://www.chuidiang.com/chuwiki/index.php?title=Manejar_ficheros_zip_con_java[/url]

Se bueno.
hola, como puedo indicar la ruta donde kiero k me guarde el archivo descomprimido del zip, mi código es el siguiente:

public void leerzip(){
try{
ZipInputStream zis = new ZipInputStream(new FileInputStream("path/file.zip"));
ZipEntry entrada;
while(null != (entrada=zis.getNextEntry())){
if (entrada.getName().equals("metadata.xml")){
FileOutputStream fos = new FileOutputStream(entrada.getName());
int leido;
byte [] buffer = new byte[1024];
while (0<(leido=zis.read(buffer))){
fos.write(buffer,0,leido);
}
fos.close();
zis.closeEntry();
}
}
zis.close();
}
catch(Exception e){
e.printStackTrace();
}
}


gracias por todo