Using of zip option

hello everybody
i am trying to compress a few files to a *.zip package, but my code does not write anything into the file. the file is created and has the size of the files to compress but the file itself is emty.
here you see my code, please focus on the try/catch block:
public static void writeZipPackage(Collection v_packages, ZipOutputStream v_outPutStream, String v_langTwo) throws Exception     {
          Iterator iter = v_packages.iterator();
byte[] readBuffer = new byte[2156];
int bytesIn = 0;
//XML File erstellen
writeXmlLz(v_packages, v_langTwo);
          while(iter.hasNext())     {
               TranslationPackage aktPackage = (TranslationPackage)iter.next();     // aktuelles Paket
               File aktPackagePath = getDirForPackage(aktPackage.getPackageName());     // hollt die Verzeichnisstruktur f�r das aktuelle Paket
               String aktPath = aktPackagePath.toString();
               aktPath = aktPath.substring(0, (aktPath.length()-8));     // aktueller Pfad
               String aktFilename = "messages_" + v_langTwo + ".properties";     // aktueller messages File
               v_outPutStream.setMethod(ZipOutputStream.DEFLATED);     // Archivierungsmodus
               try {
                    File file = new File(aktPath, aktFilename);
                    FileInputStream fileIn = new FileInputStream(file);
                    v_outPutStream.putNextEntry(new ZipEntry(aktPath));
                    // now write the content of the file to the ZipOutputStream
     while((bytesIn = fileIn.read(readBuffer)) != -1) {
          v_outPutStream.write(readBuffer, 0, bytesIn);
     }     // end of while
     v_outPutStream.flush();
     v_outPutStream.closeEntry();
     // close the Stream                     
     fileIn.close();
               } catch (Exception e) {
                    throw new Exception(e.getMessage(), e);
               }     // end of try/catch
          }     // end of while
     }     // end of writeZipPackage
i have already looked up a few tutorials how to use the zip option in java, but it did not help. So please help me. Thank you in advance.
Greetings, Wolfgang

till now i have made it to add files that are in the
same directory, but if i add a folder structure is
not in the zip file.Wild guess: change the following:
File file = new File(aktPath, aktFilename);
FileInputStream fileIn = new FileInputStream(file);
v_outPutStream.putNextEntry(new ZipEntry(aktPath));to
File file = new File(aktPath, aktFilename);
FileInputStream fileIn = new FileInputStream(file);
v_outPutStream.putNextEntry(new ZipEntry(file.getAbsolutePath()));Probably won't change anything, but it's a bit hard a guess.

Similar Messages

  • Using SDcard upgrade option in A1000

    Can we use SDcard upgrade option to root our tablet A1000G/T/F???????
    Like this-
    We can make update.zip and keep it in the root directory of USB storage in which we can keep 'su' in /system/bin and 'superuser.apk' in /system/app.
    The problem is I don't know how to make "META-INF" folder contents.
    Can anyone help me to make this meta-inf folder.
    You can say thank you by pressing the star left to my post IF I HELPED YOU

    Yes, you can build your own update.zip if you run a custom recovery like CWM.  Only Lenovo signed zips will work in the stock recovery.  META-INF/com/google/android/updater-script is where the commands go (it's a unix/linux style text file).  The CERT.RSA, CERT.SF, and MANIFEST.MF files in the META-INF folder are produced by signing the zip.  There are tools around to self-sign zips, but again only a custom recovery would accept a zip signed by anyone other than Lenovo.

  • Using the upgrade option ...

    I have already upgraded my MacBook to Leopard - I used the clean install option and backed up all my files ... my brother is now interested in upgrading but does not have the time to backup everything on his computer, if he uses the upgrade option will it keep all his preferences and everything? ... he basically wants to be able to install Leopard and then continue using his Mac without having to redo anything he already had setup on it (if that makes any sense), is that possible?

    Machieu wrote:
    I have already upgraded my MacBook to Leopard - I used the clean install option and backed up all my files ... my brother is now interested in upgrading but does not have the time to backup everything on his computer, if he uses the upgrade option will it keep all his preferences and everything? ... he basically wants to be able to install Leopard and then continue using his Mac without having to redo anything he already had setup on it (if that makes any sense), is that possible?
    If you don't have time to make a full backup, you don't have time to install Leopard.
    A backup takes less than an hour. A bad install takes forever to recover from without a backup.
    People who don't have time may make mistakes. And never upgrade a system that you need on a day-to-day basis unless you really have the time. And a backup.
    Theoretically, on a well taken care of machine, you can do a simple upgrade (I did 2 - one on each of my MBPs - but I still had a backup) and it might work. If it fails then the option is an archive and install but the archive will be over a failed install - it won't be a virgin archive. If that fails you have to do an erase and install and without a backup you have saved nada, zip, zilch.
    There's an old saying that if you take a shortcut, leave plenty of extra time.

  • Blank page is getting displayed in SAPScript when using NEW-PAGE option.

    Hello Experts,
    We have created a customized SAPScript and in this separate Script is generated based on the currency(WAERS).
    So if we have 3 different currencies, then 3 pages will be created with there details, but we are using NEW-PAGE option in
    MAIN window to separate the pages and after 3rd page it is displaying 4th page also with footer details.
    So how can we avoid last blank page which is getting displayed?

    Hi isha.walia ,
       This issue can be solved by two ways. Please take the one which suits you better.
    Solution 1: If  you need to generate separate prints for different currencies.
    In the driver program, build an internal table for different currencies which needed to be printed. (Using delete adjacent duplicates, build the internal table with exact number of currencies to be printed). Remove the NEW-PAGE option and call the script/form inside the loop. Do the necessary conditions to manipulate the print.
    Advantages of above solution: Better control on spools if needed.
    Solution 2:  Get the count of the number of pages in a variable. Inside the print loop, increment a flag counter. Check it against the variable which contains the number of pages to be printed at the end of each page. Exit the loop when the number of pages to be printed is reached.
    Advantage of above solution: Simple to write the program.
    Thanks and Regards
    Raghesh R S

  • Multiple select queries used in Excel BI report ,fetching data from Sharepoint DB(SP2010_Prod_ProjectServer) causing blockage on DB ,when more than one workbook(same copy of Excel BI Report) refreshed using Refresh All option.

    I am using mutiple select queries to fetch data from Project Server 2010 DB(its sharepoint DB) and these queries fetch data in Excel BI report by establishing connection with DB using instance name and all. I have enhance all these select queries and data
    is being fetched in secs. but when more than one copy of same Excel BI report is refreshed using 'Refresh All' option, then these select queries cause blockage on DB.
    Please let me know mitigation for this blockage issue.
    Should I use begin transaction and commit transaction statements/ shared lock statements.
    please reply

    Hi,
    run same query at the same time?

  • HT204053 I need to use an existing ID (email address) on a new iPhone. It tells me "choose another ID - that one is in use," with the option to "use existing ID," however, it is an endless loop, referring me only to change my password on the existing ID.

    I need to use an existing ID (email address) on a new iPhone. It tells me "choose another ID - that one is in use," with the option to "use existing ID," however, it is an endless loop, referring me only to change my password on the existing ID.
    How do I enable my new device with an existing ID - I do not need to change the password for the millionth time!
    None of the FAQs (or the Community choices below) address new devices, they are all about APPS and iCloud stuff.

    If it is an existing iCloud ID, you should be able to just go to Settings>iCloud and sign in with it.

  • How to use the print option for photos?

    How to use the print option for photos.  I have a wireless printer but how do I set it up?

    http://www.apple.com/support/iphone/assistant/airprint/

  • How to use the chart option in bex analyzer

    Hi Expert
    i want to know how to use the Chart in Bex Analyzer.
    Next week i hve End user Training. my user wanthow to use the chart option in Analyzer.
    plz let me know how to use chart & any Document on that plz reply me.
    Reagards
    siva
    Edited by: patel siva on Sep 16, 2008 4:34 PM

    Check here:
    https://reporting.uky.edu/BWBExContextMenu.pdf
    http://help.sap.com/saphelp_nw70/helpdata/EN/8b/4ffd9b07474279b3bbee75a60db41f/content.htm
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/5b/30d43b0527a17be10000000a114084/frameset.htm
    Thanks..
    Shambhu

  • Text field properties-Using the 'required' option in the text field properties.

    Using the required' option in the text field properties.
    The 'help' manual describes the 'required' function as this: Required Forces the user to fill in the selected form field. If the user attempts to submit the form while a required field is blank, an error message appears and the empty required form field is highlighted.
    My users ARE not submitting the form, they open the pdf, fill it out and print it. HOW can I, make a field "required', I don't want them to skip/leave blank specific fields. However, if I choose the box 'required' in the text field properties, and I begin filling out the form, I can just tab past that field that I've choose as 'required', and I do not get
    prompt/error message or anything, it allows me to save, or print.
    I WANT SOME TYPE OF message (similar to enter a company order form
    off the web, where you can't continue without filling out 'required' fields).
    Is there a step/option I am not doing?

    Then you are going to have to write some JavaScirpt to be executed by the "Will Print" document action to check all the requried fields, either by name or by the 'required' property and handle the issue of the imcomplete fields. You will not be able to stop the print, but you could display and error field so the user knows the form is incomplete and the printed form also conatains this information.

  • I'm a beginner and would like to know which Photoshop to use (so many options). The only edits I care about being able to do are: whitening teeth, smoothing complexions/taking away blemishes.  Does any photoshop have these options? I haven't been able to

    I'm a beginner and would like to know which Photoshop to use (so many options). The only edits I care about being able to do are: whitening teeth, smoothing complexions/taking away blemishes.  Does any photoshop have these options? I haven't been able to find the teeth whitening one anywhere. Also, I don't want it to lessen the high quality if my photos.  Thank you so much!!

    Hi Erika,
    I came to Lightroom quite recently (in the last month!)  from Photoshop Elements 11. I like the organization features in LR better, but for adjustments such as the ones that you mentioned I would leave LR and go back to Photoshop Elements 11, primarily because that is what I know. I don't use the subscription service, mainly because I already owned and installed the boxed version of Photoshop Elements 11 and adding it to a subscription service with Lightroom seemed redundant. I am sure someone in the community will (or has) comment(ed) that it is possible to whiten teeth and cure blemishes within LR, but I haven't figured out how to do that yet. Check out the TV Adobe free tutorials, particularly Julianne Kost's tutorials. She has a good presentation style and you might find the LR answer that you need with detailed instructions.

  • Error while exporting data via Tcode CNS43 by using spreadsheet(XXL) option

    Hello All,
    User tries to download data to spreadsheet via Tcode CNS43 by using spreadsheet(XXL) option. user gets following error.
    Selected key figure STUFE not contained in XXL output structure
    Message no. M5180
    Diagnosis
    You tried to export a key figure that is not contained in the definition of the internal table 'xxl_data'. The key figure, therefore, cannot be exported.
    System response
    The system ignored the key figure column when exporting.
    Procedure
    The table definition for 'xxl_data' must be corrected by the development department responsible for the application.
    Please note that user doesnt want to use 'save to file' option.
    Any help?

    Refer SAP notes 761839, 522925
    Regards

  • I created a playlist with 100 songs.  I want those 100 songs played using the shuffle option.  This no longer works in iTunes version 11.1.5.5  How can I get an entire  playlist to paly one song after another by using the switch option?

    I created a playlist with 100 songs.  I want those 100 songs played using the shuffle option.  This no longer works in iTunes version 11.1.5.5  How can I get an entire  playlist to paly one song after another by using the switch option?

    You're welcome.
    Going back to your original post:
    5) Tried running Itunes in 'safe mode', running itunes as an administrator..nothing.
    Was that iTunes' safe mode as opposed to Windows' safe mode? iTunes safe mode is invoked by holding down CTRL+SHIFT immediately after clicking the icon to launch iTunes and continuing to hold until this message pops up:
    Click continue, then close iTunes and reopen. With luck iTunes now opens normally every time.
    tt2

  • On a Mac OS X version 10.4.11 and itunes 9.1.1.  Can't update to itunes 10.6Trying to get a previously purchased song.  Can't use the purchased option under quick link - nothing shows up and won't let me purchase an already purchased song.  What can I do?

    On a Mac OS X version 10.4.11 and itunes 9.1.1.  Can't update to itunes 10.6, Mac too old. Trying to get a previously purchased song.  Can't use the purchased option under quick link - nothing shows up and won't let me purchase an already purchased song.  What can I do?

    If possible you need to upgrade OS X. However, what you can upgrade to is dependent on what your Mac hardware and configuration is which you have not provided in your profile.

  • Install "use typical installation options for a stand-alone primary site" All SQL Prerequisites Failed. Checks SQL before SQL is even installed?

    So I select the install option to "Use typical installation options for a stand-alone primary site" which says it includes installation of SQL 2012 SP1 on the local server.
    But then during the prerequisite checks it fails every SQL check.
    Is it just me or a giant catch 22? Am I missing something here? How is this over looked if it is what it looks like? Why even have this simple install option if it can't work?

    Take a look at my R2 install guide. This is for a stand alone primary. As Torsten states you pretty much need SQL installed and configured correctly prior to running the ConfigMgr install - along with  a few other pre-reqs.
    https://sccmentor.wordpress.com/2014/01/08/sccm-2012-r2-step-by-step-installation-guide/
    Cheers
    Paul | sccmentor.wordpress.com

  • Can I use a ZIP drive with my LCII?

    Can I just plug in a SCSI ZIP drive in my pizza-box and get it working? I can use it with mac OS 6 or 7, I need to exchange and storage files.
    Something like this : http://cgi.ebay.it/IOMEGA-ZIP-100MB-EXTERNAL-SCSI-DRIVE-MAC-PC-AOK-WARANTY-/1305 26545470?pt=PCC_Drives_Storage_Internal&hash=item1e63fd063e#ht_1239wt_1141
    Thank you!

    Do you need to store the files on Zip disks or could you use an external SCSI hard drive?  The reason I ask is that Zip drives, while very useful and convenient, had some production problems and/or a design flaw (depending on one's point of view) for a while.  The problem was named after the symptom that it caused - "Click of Death" or "Death Click."  You'd insert a disk into the drive and hear the heads click down to find the control track, then after a few moments, the heads would release, then click down again, then release, etc.  While the drive was still powered ON and trapped in this endless cycle, you couldn't eject the disk with the Mac OS "Put Away" command or by pressing the manual eject button.  Whether it was an alignment problem or not, the disks became damaged.  I don't think that Iomega ever compiled a definitive serial number range for affected units, so there's really no way to determine whether or not a used unit will develop the problem at some point.  I bought an internal SCSI Zip drive about 6 years ago at eBay and it developed the problem within a couple of weeks.  Fortunately, the seller sent me a replacement and didn't require return shipping of the bad drive.  You could be lucky and get a drive that has had little usage and delivers trouble-free performance for as long as you need it.  As for using the Zip drive with your LC II, you may need to download an older version of the IomegaWare software from Iomega's web site, to be compatible with the Mac OS you're running - especially if it's System 6.  I've never used a Zip drive with anything older than 7.5, possibly 7.1 on my LC III - I can't remember since I soon upgraded the LC III to OS 7.6.1.  With the Iomega software on a floppy disk, you can run the "Iomega Guest" program, that enables use of the Zip drive without installing the software on the hard drive.  Otherwise, installing the IomegaWare software on the hard drive would be most beneficial to you.

Maybe you are looking for