jar

package module
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

README

PkgGoDev GoReportCard GitHub Actions CI Status GitHub Actions CodeQL Status Coverage Status Codebeat badge

InstallationBuild StatusLicense


jar is a very simple Go package for reading manifest data from JAR files.

Installation

Make sure you have a working Go 1.15+ workspace (instructions), then:

go get -d pkg.re/essentialkaos/go-jar.v1

For update to the latest stable release, do:

go get -d -u pkg.re/essentialkaos/go-jar.v1

Build Status

Branch Status
master CI
develop CI

License

Apache License, Version 2.0

Documentation

Index

Examples

Constants

This section is empty.

Variables

View Source
var ErrNotJAR = errors.New("Given file is not a JAR file")
View Source
var ErrWrongManifestFormat = errors.New("Can't parse manifest file (wrong format)")

Functions

This section is empty.

Types

type Manifest

type Manifest map[string]string

func ReadFile

func ReadFile(jarFile string) (Manifest, error)

ReadFile reads JAR file and parses manifest file

Example
manifest, err := ReadFile("wagon-file-3.3.2.jar")

fmt.Printf("Error: %v\n", err)
fmt.Printf("Specification-Vendor: %s\n", manifest["Specification-Vendor"])
fmt.Printf("Implementation-Vendor-Id: %s\n", manifest["Implementation-Vendor-Id"])
fmt.Printf("Specification-Version: %s\n", manifest["Specification-Version"])
Output:

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL