Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 17
Registered: ‎12-05-2008
My Device: Not Specified

How to compress a folder?

Hi all

Can I compress a folder by ZLibOutputStream? Please help me.

Thanks

 

vi-chat, chat yahoo on blackberry! www.en.vi-chat.com
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: How to compress a folder?

You can compress a particular file, not the folder.

 

Highlighted
Developer
Posts: 49
Registered: ‎06-02-2009
My Device: Curve8530, Curve8900, Storm9500
My Carrier: Airtel, vodaphone, Wifi

Re: How to compress a folder?

As long as the folder can not be compress tar seems to be the way to go.

 

To Upload muliple file on server in single http request

(1) Create Tar file : Tar utility convert all file into single file.

(2) Compress your tar file with GZIPInputStream (or ZLibInputStream) accordingly

you will get  : yourfilename.tar.gz

(3) Send it to server. and server will uncompress and untar your file to again get mulitple file.

 

To Download muliple file from server in single http request

(1) server will provice tar.gz

(2) uncompress it using GZIPInputStream you will get  : yourfile.tar

(3) use untar utility to convert tar file to muliple file again

 

 

Download Tar utility for blackberry from http://code.google.com/p/j2metar/

OR use the attachment to get full source code with TarExample.java

 

Developer
Posts: 49
Registered: ‎06-02-2009
My Device: Curve8530, Curve8900, Storm9500
My Carrier: Airtel, vodaphone, Wifi

Re: How to compress a folder?

400px-Targzip.svg.png

Developer
Posts: 49
Registered: ‎06-02-2009
My Device: Curve8530, Curve8900, Storm9500
My Carrier: Airtel, vodaphone, Wifi

Re: How to compress a folder?

Please use the following source code for compressing and decompressing the folder in .zip format

 

http://code.google.com/p/staff/downloads/detail?name=jazzlib-j2me-src-0.0.7.zip&can=2&q=jazzlib-j2me