tFileUnarchive does not release zip files on Windows?

One Star

tFileUnarchive does not release zip files on Windows?

Hi! I download zip files from SFTP to temp dir, extract, and delete them. On Windows I can't delete zip files after extraction (after "Process finished" printed).
Anyone else have this problem?

I think it's because the var zipFile_tFileUnarchive_1 is assigned, but not used and not closed.
... why the second Thread.sleep() ?
Why tmpFileURL_tFileUnarchive_1 and not zipFileURL_tFileUnarchive_1 ? It's lowercase!!!
				} else {
// the others all use the ZIP to decompression

System.out.println("Processing archive "
+ tmpFileURL_tFileUnarchive_1 + ", please wait...");
System.out.println();

if (false && !org.talend.archive.IntegrityUtil
.isZipValid(new java.io.File(
tmpFileURL_tFileUnarchive_1))) {
Thread.sleep(1000); // To make the process terminated
// after the System.out.println
throw new RuntimeException("The file "
+ tmpFileURL_tFileUnarchive_1
+ " is corrupted, process terminated...");
}
Thread.sleep(1000);
java.util.zip.ZipFile zipFile_tFileUnarchive_1 = new java.util.zip.ZipFile(
tmpFileURL_tFileUnarchive_1);

java.io.File file_tFileUnarchive_1 = new java.io.File(
tmpFileURL_tFileUnarchive_1);

java.io.FileInputStream fileStream_tFileUnarchive_1 = new java.io.FileInputStream(
file_tFileUnarchive_1);
java.io.BufferedInputStream bufferedStream_tFileUnarchive_1 = new java.io.BufferedInputStream(
fileStream_tFileUnarchive_1);

// org.apache.tools.zip.ZipFile zip_tFileUnarchive_1 = new
// org.apache.tools.zip.ZipFile(zipFileURL_tFileUnarchive_1);
java.util.zip.ZipInputStream zipInputStream_tFileUnarchive_1 = new java.util.zip.ZipInputStream(
bufferedStream_tFileUnarchive_1);
java.util.zip.ZipEntry entry_tFileUnarchive_1;
// java.util.Enumeration enuFiles_tFileUnarchive_1 =
// zip_tFileUnarchive_1.getEntries();
java.io.InputStream is_tFileUnarchive_1 = null;

// while (enuFiles_tFileUnarchive_1.hasMoreElements()) {
while ((entry_tFileUnarchive_1 = zipInputStream_tFileUnarchive_1
.getNextEntry()) != null) {
// org.apache.tools.zip.ZipEntry entry_tFileUnarchive_1
// = (org.apache.tools.zip.ZipEntry)
// enuFiles_tFileUnarchive_1.nextElement();

boolean isDirectory_tFileUnarchive_1 = entry_tFileUnarchive_1
.isDirectory();
// if (!isDirectory_tFileUnarchive_1 ) {
// get the input stream
// is_tFileUnarchive_1 =
// zip_tFileUnarchive_1.getInputStream(entry_tFileUnarchive_1);
// }
String filename_tFileUnarchive_1 = entry_tFileUnarchive_1
.getName();

util_tFileUnarchive_1.output(
outputPath_tFileUnarchive_1,
filename_tFileUnarchive_1,
isDirectory_tFileUnarchive_1,
zipInputStream_tFileUnarchive_1);

}
bufferedStream_tFileUnarchive_1.close();
zipInputStream_tFileUnarchive_1.close();
System.out.println();
System.out.println("Process finished");

}
One Star

Re: tFileUnarchive does not release zip files on Windows?

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Have you checked out Talend’s 2019 Summer release yet?

Find out about Talend's 2019 Summer release

Blog

Talend Summer 2019 – What’s New?

Talend continues to revolutionize how businesses leverage speed and manage scale

Watch Now

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog