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! ~

All Replies
Forteen Stars TRF
Forteen 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.

Forteen Stars TRF
Forteen 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! ~
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.