Create a TAR File (tarball) using Coldfusion\Java on a windows server

I need to create a TAR file containing multiple files on a windows server using Coldfusion\Java. I have found lots of examples of unpacking them, but very little on creating them. I found this example of using gzip to add some text to a file and that works, but I need to add files. I'm also not 100% sure that gzip is the same thing as building a tarball. This project was assigned to me with a very short turn-around and I'm spinning my wheels so any help in the right direction is greatly appreciated:
    
<cfset lineBreak = chr(13) & chr(10) />
    <!--- open the sitemap file --->
    <cfset tarFilePath = "#application.imageingFolder#DTSimages\Pending\tiff.gz" />
    #tarFilePath#
    <!--- create streams --->
    <cfset outputStream = CreateObject("java", "java.io.FileOutputStream").Init(
    			CreateObject("java","java.io.File").Init(tarFilePath)) />
    <cfset gzipStream = CreateObject("java", "java.util.zip.GZIPOutputStream").Init(outputStream) />
    <cfsavecontent variable="siteMapHeader"><?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
    	xmlns:image="http://www.sitemaps.org/schemas/sitemap-image/1.1"
    	xmlns:video="http://www.sitemaps.org/schemas/sitemap-video/1.1">
    </cfsavecontent>
    <cfset siteMapFooter = "</urlset>" />
    <cfset gzipStream.write(ToString(siteMapHeader).GetBytes()) />
    
    <cfset gzipStream.close() />
    <cfset outputStream.close() />

Open in new window


Win Server 2012
ColdFusion 10
Java Version 1.7.0_15
Rob EAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CEHJCommented:
I need to create a TAR file containing multiple files on a windows server using Coldfusion\Java
That's slightly odd - tar files are native to Unix but foreign to Windows.

You will need a special library as they are not supported in the JRE. I'm happy to work with you on this in Live ( https://www.experts-exchange.com/live/ )

Gzip is a compression method for single files
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CEHJCommented:
The solution is available here:
Yes, as i said, you need (for a proper solution) a 3rd party library
0
Rob EAuthor Commented:
It was solved by someone on another site
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.