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

123 lines
2.8 KiB
Markdown
Raw Normal View History

2022-01-02 11:00:52 -08:00
[Home](https://kellyjonbrazil.github.io/jc/)
2022-01-25 17:07:47 -08:00
<a id="jc.parsers.jar_manifest"></a>
# jc.parsers.jar\_manifest
2022-01-02 11:00:52 -08:00
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):
2022-01-25 17:07:47 -08:00
$ cat MANIFEST.MF | jc --jar-manifest
2022-01-02 11:00:52 -08:00
Usage (module):
2022-01-25 17:07:47 -08:00
import jc
result = jc.parse('jar_manifest', jar_manifest_file_output)
2022-01-18 15:38:03 -08:00
2022-01-25 17:07:47 -08:00
or
2022-01-18 15:38:03 -08:00
2022-01-25 17:07:47 -08:00
import jc.parsers.jar_manifest
result = jc.parsers.jar_manifest.parse(jar_manifest_file_output)
2022-01-02 11:00:52 -08:00
Schema:
2022-01-25 17:07:47 -08:00
[
{
"key1": string,
"key2": string
}
]
**Examples**:
$ cat MANIFEST.MF | jc --jar-manifest -p
$ 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
$ cat MANIFEST.MF | jc --jar-manifest -p
[
{
- `"Import_Package"` - "com.conversantmedia.util.concurrent;resoluti...",
- `"Export_Package"` - "org.apache.logging.log4j.core;uses:=\"org.ap...",
- `"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",
...
}
]
$ unzip -c 'apache-log4j-2.16.0-bin/*.jar' META-INF/MANIFEST.MF | \\
jc --jar-manifest -p
[
...
{
- `"Archive"` - "apache-log4j-2.16.0-bin/log4j-spring-boot-2.16.0-so...",
- `"Manifest_Version"` - "1.0",
- `"Built_By"` - "matt",
- `"Created_By"` - "Apache Maven 3.8.4",
- `"Build_Jdk"` - "1.8.0_312"
},
{
- `"Archive"` - "apache-log4j-2.16.0-bin/log4j-spring-boot-2.16.0-ja...",
- `"Manifest_Version"` - "1.0",
- `"Built_By"` - "matt",
- `"Created_By"` - "Apache Maven 3.8.4",
- `"Build_Jdk"` - "1.8.0_312"
},
{
- `"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...",
- `"Manifest_Version"` - "1.0",
- `"Bundle_License"` - "https://www.apache.org/licenses/LICENSE-2.0.txt",
...
}
...
]
<a id="jc.parsers.jar_manifest.info"></a>
## info Objects
2022-01-02 11:00:52 -08:00
```python
2022-01-25 17:07:47 -08:00
class info()
2022-01-02 11:00:52 -08:00
```
2022-01-25 17:07:47 -08:00
2022-01-02 11:00:52 -08:00
Provides parser metadata (version, author, etc.)
2022-01-25 17:07:47 -08:00
<a id="jc.parsers.jar_manifest.parse"></a>
#### parse
2022-01-02 11:00:52 -08:00
```python
2022-01-25 17:07:47 -08:00
def parse(data, raw=False, quiet=False)
2022-01-02 11:00:52 -08:00
```
Main text parsing function
2022-01-25 17:07:47 -08:00
**Arguments**:
2022-01-02 11:00:52 -08:00
2022-01-25 17:07:47 -08:00
- `data` - (string) text data to parse
- `raw` - (boolean) unprocessed output if True
- `quiet` - (boolean) suppress warning messages if True
2022-01-02 11:00:52 -08:00
2022-01-25 17:07:47 -08:00
**Returns**:
2022-01-02 11:00:52 -08:00
2022-01-25 17:07:47 -08:00
List of Dictionaries. Raw or processed structured data.
2022-01-02 11:00:52 -08:00
## Parser Information
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
Version 0.01 by Matt J (https://github.com/listuser)