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 war file which is a simple dynamic web application where I
I have an application which is packaged as a .war file. It has GWT
Within my service I have an mbean which is accessed by my war file.
I have multiple (8) WAR files and 1 EAR file that I want to
I have a spring web application (currently packaged as a war file) which I
I have a Spring+Hibernate application, which I compile to *.war file and deploy it
i have a problem with maven built .war file. i have a dependency on
I deployed a simple war file (vivek.war) which contains a simple index.jsp file successfully
I am using maven to build applications. I have deployed a WAR file containing

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.