Package org.miaixz.bus.core.xyz
Class ManifestKit
java.lang.Object
org.miaixz.bus.core.xyz.ManifestKit
Jar包中manifest.mf文件获取和解析工具类
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ManifestgetManifest(File classpathItem) 获取 jar 包文件或项目目录下的 Manifeststatic ManifestgetManifest(Class<?> cls) 根据 class 获取 所在 jar 包文件的 Manifest 如果这个类不在jar包中,返回nullstatic ManifestgetManifest(JarURLConnection connection) 根据JarURLConnection获取 jar 包文件的 Manifeststatic ManifestgetManifest(JarFile jarFile) 根据JarURLConnection获取 jar 包文件的 Manifest
-
Constructor Details
-
ManifestKit
public ManifestKit()
-
-
Method Details
-
getManifest
根据 class 获取 所在 jar 包文件的 Manifest 如果这个类不在jar包中,返回null- Parameters:
cls- 类- Returns:
- Manifest
- Throws:
InternalException- IO异常
-
getManifest
获取 jar 包文件或项目目录下的 Manifest- Parameters:
classpathItem- 文件路径- Returns:
- Manifest
- Throws:
InternalException- IO异常
-
getManifest
根据JarURLConnection获取 jar 包文件的 Manifest- Parameters:
connection-JarURLConnection- Returns:
- Manifest
- Throws:
InternalException- IO异常
-
getManifest
根据JarURLConnection获取 jar 包文件的 Manifest- Parameters:
jarFile-JarURLConnection- Returns:
- Manifest
- Throws:
InternalException- IO异常
-