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

  • SEARCH
  • Home
  • 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 4598094
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:21:00+00:00 2026-05-21T23:21:00+00:00

I have a war file which does not contains manifest not even META-INF folder.

  • 0

I have a war file which does not contains manifest not even META-INF folder. Now my problem is that I wrote a code which was working fine with normal war files containing manifests. Now I am required to read a war file which does not contain manifest.

When I check

while ((ze = zis.getNextEntry()) != null)

This condition is just skipped. Is there any API which treats it just as a normal zip file or is there any workaround.

I have tried with JarEntry as well as ZipEntry. Here is a small snippet that should be explanatory.

try {
            FileInputStream fis = new FileInputStream(applicationPack);
            ZipArchiveInputStream zis = new ZipArchiveInputStream(fis);
            ArchiveEntry ze = null;
            File applicationPackConfiguration;           
            while ((ze = zis.getNextEntry()) != null) {
            // do someting
}

What can be done ?

  • 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-05-21T23:21:01+00:00Added an answer on May 21, 2026 at 11:21 pm

    You can simply list contents with ZipFile class:

    try {
      // Open the ZIP file
      ZipFile zf = new ZipFile("filename.zip");
    
      // Enumerate each entry
      for (Enumeration entries = zf.entries(); entries.hasMoreElements();) {
        // Get the entry name
        String zipEntryName = ((ZipEntry)entries.nextElement()).getName();
      }
    } catch (IOException e) {
    }
    

    Example taken from here. Another example for retrieving the file from zip.

    Update:

    Code above indeed has problems with zip files that contain only directory as a top-level element.

    This code works (tested):

        try {
            // Open the ZIP file
            FileInputStream fis = new FileInputStream(new File("/your.war"));
            ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis));
    
            ZipEntry entry = null;
    
            while ((entry = zis.getNextEntry()) != null)
                // Get the entry name
                System.out.println(entry.getName());
        } catch (IOException e) {
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application.war folder (not as file) which contains jaxen-1.1.1.jar (in the WEB-INF/lib)
I have a theme.war file, which I've placed in the server/tomcat/tomcat6/webapps of liferay folder.
How do I create a grails war file so that it doesn't have the
I have a web application (.war) that contains some static files (e.g. MS word
I have a spring web application (currently packaged as a war file) which I
I have heard a few people say that deploying a portlet war file (or
I have an ear file, containing a war file. The war contains a number
I have 2 different webapps (package into different war files) which needs to share
Hopefully this will not spark a religious war... We have a web based app
I want to create a WAR that would only contain a single zip file

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.