Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8830849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:11:08+00:00 2026-06-14T08:11:08+00:00

good day! Let’s say that I have a folder named Data which contains multiple

  • 0

good day!

Let’s say that I have a folder named “Data” which contains multiple folders:

  • Data1_Folder.
  • Data2_Folder.
  • Data3_Folder.
  • Data4_Folder.

and I need to compress only Data2_Folder and Data3_Folder, In another words, the user will decide which folders he wants to compress.

I’m using a for loop to read data from DB for chosen IDs and write these data in separate excel sheets. all of the files will be stored under their ID name folder (Data#_Folder) under the main Data folder.

at the end of the loop these are the statements to create the file and compress them.

Excel.writeFile((String)DataID.get(i),TempArray);
Folder2Compress = new String[]{CompressingFolders.CompressFiles("D:\\Data/"+DataID.get(i).toString())};

unfortunately, only the last created folder will be compressed. How can I make it to compress all chosen folders?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:11:09+00:00Added an answer on June 14, 2026 at 8:11 am

    You add only a single folder to the array Folder2Compress. Use a List<String> instead and add all folders to the list:

    List<String> folders = new ArrayList<String>();
    for( .... ) {
        ...
        folders.add("D:\\Data/"+DataID.get(i));
    }
    

    Now you can change CompressingFolders.CompressFiles() to take this list as input and add all folders to the result.

    Note: You may want to look at the Java naming convention.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good day, i have mongodb database filled with some data, i ensured that data
Good day, I have a class that implements the LoaderCallbacks, and hence have the
Good day I have a custom TextBox that has a IndicatorTextBox.ui.xml file as well
Good Day, I have a simple working routine in Perl that swaps two words:
Let's say that you have a Model that looks kind of like this: public
Good day, I have a practical mysql question to which I can't find help
Good day, I have a gen_server process which does some long-running state-updating tasks periodically
Good day! Let us have a source file main.cpp and a CMakeLists.txt file containing
Good day, I am working on a Stratix III FPGA which contains M9K block
Good day, I have like 15 images I need to be buttons. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.