Hi all,
I need to create a Zip file and once it's created, I have to change it's name. The code I've developed is the following:
String[] filenames = new String[]{"newUsers.csv"};
byte[] buf = new byte[1024];
try {
ZipOutputStream out = new ZipOutputStream( new FileOutputStream("newUsers.zip"));
for (int i=0; i<filenames.length; i++){
FileInputStream in = new FileInputStream(filenames);
out.putNextEntry(new ZipEntry(filenames[i]));
int len;
while ((len = in.read(buf)) > 0){
out.write(buf, 0, len);
}
out.closeEntry();
in.close();
}
out.close();
} catch (IOException e) {
e.printStackTrace();
}This code creates my ZIP, what do I have to do to change it's name once it's finished? I home that someone can help me, it's quite urgent