Javatpoint Logo
Javatpoint Logo

Tika Jar File Extraction

To extract Jar (Java ARchive) file, Tika provides PackageParser class. This class is used to extract content and metadata from the Jar file. It is located into the org.apache.tika.parser.pkg package and contains various constructors and methods that are tabled below.

Tika PackageParser Constructor

Constructor Description
public PackageParser() public PackageParser()

Tika PackageParser Methods

Method Description
public Set<MediaType> getSupportedTypes(ParseContext context) It returns the set of media types supported by this parser.
public void parse(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException It parses a document stream into a sequence of XHTML SAX events.
protected static Metadata handleEntryMetadata(String name, Date createAt, Date modifiedAt, Long size, XHTMLContentHandler xhtml) throws SAXException, IOException, TikaException

Tika PackageParser Example


Document Content:
Manifest-Version: 1.0
Created-By: 1.7.0_01 (Oracle Corporation)
Main-Class: First

public synchronized class First {
    void First();
    public static void main(String[]);
Document Metadata:
Content-Type:   application/zip

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA