Method getManifest in java.util.jar.JarInputStream returns null Manifest for a Indexed JarFile . While it is returning exact values for an unindexed Jarfile .
This occurs in Win32 platforms (95,98,NT) and Solaris 2.7
Steps to reproduce the bug
---------------------------
1) set the path to latest merlin build
2) copy the attached files
3) javac GetManifestTests.java
4) java GetManifestTests
Name: jl125535 Date: 11/11/2002
EXTRA RELEVANT SYSTEM CONFIGURATION :
Construct one jar file that contains manifest file so that
manifest file is not first entry in jar file.(Use for
example zip tool)
A DESCRIPTION OF THE PROBLEM :
Even the jar file contains manifest file, the getManifest
method returns null
Jar tool provided by Sun will always generate such jar file
that manifest is first entry.
But specification of jar file does not say that manifest
must be the first entry.
http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. create jar file that contains manifest file, so that
mnaifest is not first entry in jar file(use for example zip
tool)
2. run example code(Test <jarfile name>)
EXPECTED VERSUS ACTUAL BEHAVIOR :
Test program prints out:
Manifest is:null
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.util.jar.JarInputStream;
import java.util.jar.Manifest;
import java.io.FileInputStream;
public class Test
{
public static void main(String arg[])
{
try
{
FileInputStream fin = new FileInputStream(arg[0]);
JarInputStream jin = new JarInputStream(fin);
Manifest m = jin.getManifest();
System.out.println("Manifest is:" + m);
}
catch(Exception e )
{
}
}
}
---------- END SOURCE ----------
(Review ID: 166718)
======================================================================
This occurs in Win32 platforms (95,98,NT) and Solaris 2.7
Steps to reproduce the bug
---------------------------
1) set the path to latest merlin build
2) copy the attached files
3) javac GetManifestTests.java
4) java GetManifestTests
Name: jl125535 Date: 11/11/2002
EXTRA RELEVANT SYSTEM CONFIGURATION :
Construct one jar file that contains manifest file so that
manifest file is not first entry in jar file.(Use for
example zip tool)
A DESCRIPTION OF THE PROBLEM :
Even the jar file contains manifest file, the getManifest
method returns null
Jar tool provided by Sun will always generate such jar file
that manifest is first entry.
But specification of jar file does not say that manifest
must be the first entry.
http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. create jar file that contains manifest file, so that
mnaifest is not first entry in jar file(use for example zip
tool)
2. run example code(Test <jarfile name>)
EXPECTED VERSUS ACTUAL BEHAVIOR :
Test program prints out:
Manifest is:null
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.util.jar.JarInputStream;
import java.util.jar.Manifest;
import java.io.FileInputStream;
public class Test
{
public static void main(String arg[])
{
try
{
FileInputStream fin = new FileInputStream(arg[0]);
JarInputStream jin = new JarInputStream(fin);
Manifest m = jin.getManifest();
System.out.println("Manifest is:" + m);
}
catch(Exception e )
{
}
}
}
---------- END SOURCE ----------
(Review ID: 166718)
======================================================================
- relates to
-
JDK-5046178 JarInputStream doesn't return Manifest object
-
- Closed
-
-
JDK-4696354 jar umf puts Manifest file at end of jar
-
- Closed
-