Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
javvaji
Creator II

Unarchive the .gzip files

Hi Team,

 

I am having the .gzip files in FTP, we need to unarchive the files. I tried using tFileUnarchive component but i was getting the following error. Could any one help me on this.

Below is the error code

 

Exception in component tFileUnarchive_2
java.util.zip.ZipException: archive is not a ZIP archive
at org.apache.commons.compress.archivers.zip.ZipFile.positionAtEndOfCentralDirectoryRecord(ZipFile.java:847)
at org.apache.commons.compress.archivers.zip.ZipFile.positionAtCentralDirectory(ZipFile.java:777)
at org.apache.commons.compress.archivers.zip.ZipFile.populateFromCentralDirectory(ZipFile.java:522)
at org.apache.commons.compress.archivers.zip.ZipFile.<init>(ZipFile.java:216)
at org.apache.commons.compress.archivers.zip.ZipFile.<init>(ZipFile.java:192)
[FATAL]: local_project.ksgfileloading_0_1.KSGFileLoading - tFileUnarchive_2 archive is not a ZIP archive
at org.apache.commons.compress.archivers.zip.ZipFile.<init>(ZipFile.java:164)
at com.talend.compress.zip.Unzip.doUnzipWithoutDecryption(Unzip.java:191)
at com.talend.compress.zip.Unzip.doUnzip(Unzip.java:76)
at local_project.ksgfileloading_0_1.KSGFileLoading.tFileUnarchive_2Process(KSGFileLoading.java:1394)
at local_project.ksgfileloading_0_1.KSGFileLoading.tFileList_2Process(KSGFileLoading.java:1110)
at local_project.ksgfileloading_0_1.KSGFileLoading.tFileList_1Process(KSGFileLoading.java:645)
at local_project.ksgfileloading_0_1.KSGFileLoading.runJobInTOS(KSGFileLoading.java:1687)
at local_project.ksgfileloading_0_1.KSGFileLoading.main(KSGFileLoading.java:1521)
[statistics] disconnected

 

Thanks,

Bharath.

 

Labels (1)
1 Solution

Accepted Solutions
5 Replies
TRF
Champion II

Hi,

Depending on your TOS version, GZIP format maybe not supported by tFileArchive/tFileUnarchive components.

Here is a workaround you may check for archinving https://www.linkedin.com/pulse/how-compressarchive-files-gzip-format-using-talend-open-vikram-takkar....

You'll probably be inspired for the reverse operation.

javvaji
Creator II
Author

Thanks for the reply.

 

But in that link we don't have code to unarchive the .gzip files. we have only how to compress the file to .gzip format.

 

 

Thanks,

Bharath.

TRF
Champion II

I didn't said this is the solution, I just said you'll probably be inspired by it.

Vinlogs
Creator

See if you can use this java code to achieve your purpose in talend
https://examples.javacodegeeks.com/core-java/io/fileinputstream/decompress-a-gzip-file-in-java-examp...
javvaji
Creator II
Author

Thanks for reply vineet.

 

I also referred the same site and achieved it. But any way thanks for reply.

 

Thanks,

Bharath.