Unarchive the .gzip files

Eight Stars

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.

 


Accepted Solutions
Six Stars

Re: Unarchive the .gzip files

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...
~ ````Please don't forget to give "kudos" when a reply is helpful and click "Accept the solution" when you think you're good with it. Thanks! ~

View solution in original post


All Replies
Highlighted
Fifteen Stars TRF
Fifteen Stars

Re: Unarchive the .gzip files

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.


TRF
Eight Stars

Re: Unarchive the .gzip files

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.

Fifteen Stars TRF
Fifteen Stars

Re: Unarchive the .gzip files

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


TRF
Six Stars

Re: Unarchive the .gzip files

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...
~ ````Please don't forget to give "kudos" when a reply is helpful and click "Accept the solution" when you think you're good with it. Thanks! ~

View solution in original post

Eight Stars

Re: Unarchive the .gzip files

Thanks for reply vineet.

 

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

 

Thanks,

Bharath.

 

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

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog