Delete file if exists
This commit is contained in:
@@ -126,12 +126,17 @@ public class ZipUtils {
|
||||
{
|
||||
ZipEntry zipEntry = zipEntries.nextElement();
|
||||
File newFile = new File(destination, zipEntry.getName());
|
||||
|
||||
System.out.println("Got file " + newFile.getAbsolutePath());
|
||||
//create sub directories
|
||||
newFile.getParentFile().mkdirs();
|
||||
|
||||
if (!zipEntry.isDirectory())
|
||||
{
|
||||
if(newFile.exists())
|
||||
{
|
||||
System.out.println("File " + newFile + "exists, replacing");
|
||||
newFile.delete();
|
||||
}
|
||||
FileOutputStream outputStream = null;
|
||||
BufferedInputStream inputStream = null;
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user