declare namespace java {
namespace util {
namespace jar {
/**
* The JarFile
class is used to read the contents of a jar file
* from any file that can be opened with java.io.RandomAccessFile
.
* It extends the class java.util.zip.ZipFile
with support
* for reading an optional Manifest
entry. The
* Manifest
can be used to specify meta-information about the
* jar file and its entries.
*
Unless otherwise noted, passing a null argument to a constructor
* or method in this class will cause a {@link NullPointerException} to be
* thrown.
* If the verify flag is on when opening a signed jar file, the content of the
* file is verified against its signature embedded inside the file. Please note
* that the verification process does not include validating the signer's
* certificate. A caller should inspect the return value of
* {@link JarEntry#getCodeSigners()} to further determine if the signature
* can be trusted.
* @author David Connelly
* @see Manifest
* @see java.util.zip.ZipFile
* @see java.util.jar.JarEntry
* @since 1.2
*/
// @ts-ignore
class JarFile extends java.util.zip.ZipFile {
/**
* Creates a new JarFile
to read from the specified
* file name
. The JarFile
will be verified if
* it is signed.
* @param name the name of the jar file to be opened for reading
* @throws IOException if an I/O error has occurred
* @throws SecurityException if access to the file is denied
* by the SecurityManager
*/
// @ts-ignore
constructor(name: java.lang.String | string)
/**
* Creates a new JarFile
to read from the specified
* file name
.
* @param name the name of the jar file to be opened for reading
* @param verify whether or not to verify the jar file if
* it is signed.
* @throws IOException if an I/O error has occurred
* @throws SecurityException if access to the file is denied
* by the SecurityManager
*/
// @ts-ignore
constructor(name: java.lang.String | string, verify: boolean)
/**
* Creates a new JarFile
to read from the specified
* File
object. The JarFile
will be verified if
* it is signed.
* @param file the jar file to be opened for reading
* @throws IOException if an I/O error has occurred
* @throws SecurityException if access to the file is denied
* by the SecurityManager
*/
// @ts-ignore
constructor(file: java.io.File)
/**
* Creates a new JarFile
to read from the specified
* File
object.
* @param file the jar file to be opened for reading
* @param verify whether or not to verify the jar file if
* it is signed.
* @throws IOException if an I/O error has occurred
* @throws SecurityException if access to the file is denied
* by the SecurityManager.
*/
// @ts-ignore
constructor(file: java.io.File, verify: boolean)
/**
* Creates a new JarFile
to read from the specified
* File
object in the specified mode. The mode argument
* must be either OPEN_READ or OPEN_READ | OPEN_DELETE.
* @param file the jar file to be opened for reading
* @param verify whether or not to verify the jar file if
* it is signed.
* @param mode the mode in which the file is to be opened
* @throws IOException if an I/O error has occurred
* @throws IllegalArgumentException
* if the mode argument is invalid
* @throws SecurityException if access to the file is denied
* by the SecurityManager
* @since 1.3
*/
// @ts-ignore
constructor(file: java.io.File, verify: boolean, mode: number /*int*/)
/**
* The JAR manifest file name.
*/
// @ts-ignore
public static readonly MANIFEST_NAME: java.lang.String | string
/**
* Returns the jar file manifest, or null
if none.
* @return the jar file manifest, or null
if none
* @throws IllegalStateException
* may be thrown if the jar file has been closed
* @throws IOException if an I/O error has occurred
*/
// @ts-ignore
public getManifest(): java.util.jar.Manifest
/**
* Returns the JarEntry
for the given entry name or
* null
if not found.
* @param name the jar file entry name
* @return the JarEntry
for the given entry name or
* null
if not found.
* @throws IllegalStateException
* may be thrown if the jar file has been closed
* @see java.util.jar.JarEntry
*/
// @ts-ignore
public getJarEntry(name: java.lang.String | string): java.util.jar.JarEntry
/**
* Returns the ZipEntry
for the given entry name or
* null
if not found.
* @param name the jar file entry name
* @return the ZipEntry
for the given entry name or
* null
if not found
* @throws IllegalStateException
* may be thrown if the jar file has been closed
* @see java.util.zip.ZipEntry
*/
// @ts-ignore
public getEntry(name: java.lang.String | string): java.util.zip.ZipEntry
/**
* Returns an enumeration of the zip file entries.
*/
// @ts-ignore
public entries(): java.util.Enumeration