Added in API level 1

Manifest

open class Manifest : Cloneable
kotlin.Any
   ↳ java.util.jar.Manifest

The Manifest class is used to maintain Manifest entry names and their associated Attributes. There are main Manifest Attributes as well as per-entry Attributes. For information on the Manifest format, please see the Manifest format specification.

Summary

Public constructors

Constructs a new, empty Manifest.

Constructs a new Manifest from the specified input stream.

Constructs a new Manifest that is a copy of the specified Manifest.

Public methods
open Unit

Clears the main Attributes as well as the entries in this Manifest.

open Any

Returns a shallow copy of this Manifest.

open Boolean
equals(other: Any?)

Returns true if the specified Object is also a Manifest and has the same main Attributes and entries.

open Attributes!

Returns the Attributes for the specified entry name.

open MutableMap<String!, Attributes!>!

Returns a Map of the entries contained in this Manifest.

open Attributes!

Returns the main Attributes for the Manifest.

open Int

Returns the hash code for this Manifest.

open Unit

Reads the Manifest from the specified InputStream.

open Unit

Writes the Manifest to the specified OutputStream.

Public constructors

Manifest

Added in API level 1
Manifest()

Constructs a new, empty Manifest.

Manifest

Added in API level 1
Manifest(is: InputStream!)

Constructs a new Manifest from the specified input stream.

Parameters
is InputStream!: the input stream containing manifest data
Exceptions
java.io.IOException if an I/O error has occurred

Manifest

Added in API level 1
Manifest(man: Manifest!)

Constructs a new Manifest that is a copy of the specified Manifest.

Parameters
man Manifest!: the Manifest to copy

Public methods

clear

Added in API level 1
open fun clear(): Unit

Clears the main Attributes as well as the entries in this Manifest.

clone

Added in API level 1
open fun clone(): Any

Returns a shallow copy of this Manifest. The shallow copy is implemented as follows:

public Object clone() { return new Manifest(this); }
  

Return
Any a shallow copy of this Manifest
Exceptions
java.lang.CloneNotSupportedException if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.

equals

Added in API level 1
open fun equals(other: Any?): Boolean

Returns true if the specified Object is also a Manifest and has the same main Attributes and entries.

Parameters
obj the reference object with which to compare.
o the object to be compared
Return
Boolean true if the specified Object is also a Manifest and has the same main Attributes and entries

getAttributes

Added in API level 1
open fun getAttributes(name: String!): Attributes!

Returns the Attributes for the specified entry name. This method is defined as:

return (Attributes)getEntries().get(name)
  
Though null is a valid name, when getAttributes(null) is invoked on a Manifest obtained from a jar file, null will be returned. While jar files themselves do not allow null-named attributes, it is possible to invoke getEntries on a Manifest, and on that result, invoke put with a null key and an arbitrary value. Subsequent invocations of getAttributes(null) will return the just-put value.

Note that this method does not return the manifest's main attributes; see getMainAttributes.

Parameters
name String!: entry name
Return
Attributes! the Attributes for the specified entry name

getEntries

Added in API level 1
open fun getEntries(): MutableMap<String!, Attributes!>!

Returns a Map of the entries contained in this Manifest. Each entry is represented by a String name (key) and associated Attributes (value). The Map permits the null key, but no entry with a null key is created by read, nor is such an entry written by using write.

Return
MutableMap<String!, Attributes!>! a Map of the entries contained in this Manifest

getMainAttributes

Added in API level 1
open fun getMainAttributes(): Attributes!

Returns the main Attributes for the Manifest.

Return
Attributes! the main Attributes for the Manifest

hashCode

Added in API level 1
open fun hashCode(): Int

Returns the hash code for this Manifest.

Return
Int a hash code value for this object.

read

Added in API level 1
open fun read(is: InputStream!): Unit

Reads the Manifest from the specified InputStream. The entry names and attributes read will be merged in with the current manifest entries.

Parameters
is InputStream!: the input stream
Exceptions
java.io.IOException if an I/O error has occurred

write

Added in API level 1
open fun write(out: OutputStream!): Unit

Writes the Manifest to the specified OutputStream. Attributes.Name.MANIFEST_VERSION must be set in MainAttributes prior to invoking this method.

Parameters
out OutputStream!: the output stream
Exceptions
java.io.IOException if an I/O error has occurred