1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-12-18 00:18:28 +02:00
Files
jc/docs/parsers/jar_manifest.md

111 lines
2.8 KiB
Markdown
Raw Normal View History

2022-01-02 11:00:52 -08:00
[Home](https://kellyjonbrazil.github.io/jc/)
# jc.parsers.jar_manifest
2022-01-03 09:22:35 -08:00
jc - JSON CLI output utility `MANIFEST.MF` file parser
2022-01-02 11:00:52 -08:00
Usage (cli):
$ cat MANIFEST.MF | jc --jar-manifest
Usage (module):
2022-01-18 15:38:03 -08:00
import jc
result = jc.parse('jar_manifest', jar_manifest_file_output)
or
2022-01-02 11:00:52 -08:00
import jc.parsers.jar_manifest
result = jc.parsers.jar_manifest.parse(jar_manifest_file_output)
Schema:
[
{
"key1": string,
"key2": string
}
]
Examples:
$ cat MANIFEST.MF | jc --jar-manifest -p
2022-01-19 17:30:14 -08:00
$ unzip -c log4j-core-2.16.0.jar META-INF/MANIFEST.MF | \
jc --jar-manifest -p
$ unzip -c 'apache-log4j-2.16.0-bin/*.jar' META-INF/MANIFEST.MF | \
jc --jar-manifest -p
2022-01-02 11:00:52 -08:00
$ cat MANIFEST.MF | jc --jar-manifest -p
[
{
2022-01-19 17:30:14 -08:00
"Import_Package": "com.conversantmedia.util.concurrent;resoluti...",
"Export_Package": "org.apache.logging.log4j.core;uses:="org.ap...",
2022-01-02 11:00:52 -08:00
"Manifest_Version": "1.0",
"Bundle_License": "https://www.apache.org/licenses/LICENSE-2.0.txt",
"Bundle_SymbolicName": "org.apache.logging.log4j.core",
"Built_By": "matt",
"Bnd_LastModified": "1639373735804",
"Implementation_Vendor_Id": "org.apache.logging.log4j",
"Specification_Title": "Apache Log4j Core",
"Log4jReleaseManager": "Matt Sicker",
...
}
]
2022-01-19 17:30:14 -08:00
$ unzip -c 'apache-log4j-2.16.0-bin/*.jar' META-INF/MANIFEST.MF | \
jc --jar-manifest -p
2022-01-02 11:00:52 -08:00
[
...
{
2022-01-19 17:30:14 -08:00
"Archive": "apache-log4j-2.16.0-bin/log4j-spring-boot-2.16.0-so...",
2022-01-02 11:00:52 -08:00
"Manifest_Version": "1.0",
"Built_By": "matt",
"Created_By": "Apache Maven 3.8.4",
"Build_Jdk": "1.8.0_312"
},
{
2022-01-19 17:30:14 -08:00
"Archive": "apache-log4j-2.16.0-bin/log4j-spring-boot-2.16.0-ja...",
2022-01-02 11:00:52 -08:00
"Manifest_Version": "1.0",
"Built_By": "matt",
"Created_By": "Apache Maven 3.8.4",
"Build_Jdk": "1.8.0_312"
},
{
2022-01-19 17:30:14 -08:00
"Bundle_SymbolicName": "org.apache.logging.log4j.spring-cloud-c...",
"Export_Package": "org.apache.logging.log4j.spring.cloud.config...",
"Archive": "apache-log4j-2.16.0-bin/log4j-spring-cloud-config-c...",
2022-01-02 11:00:52 -08:00
"Manifest_Version": "1.0",
"Bundle_License": "https://www.apache.org/licenses/LICENSE-2.0.txt",
...
}
...
]
## info
```python
info()
```
Provides parser metadata (version, author, etc.)
## parse
```python
parse(data, raw=False, quiet=False)
```
Main text parsing function
Parameters:
data: (string) text data to parse
2022-01-21 07:42:03 -08:00
raw: (boolean) unprocessed output if True
2022-01-02 11:00:52 -08:00
quiet: (boolean) suppress warning messages if True
Returns:
List of Dictionaries. Raw or processed structured data.
## Parser Information
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
Version 0.01 by Matt J (https://github.com/listuser)