Utility for managing JAR files.
Jar file manager performs operations with jar files simply and easily.
- Add one of the options below to the pom.xml file:
<dependency>
<groupId>io.github.wniemiec-io-java</groupId>
<artifactId>jar-file-manager</artifactId>
<version>LATEST</version>
</dependency>
- Run
$ mvn install
- Use it
[...]
import wniemiec.io.java.JarFileManager;
[...]
Path jarFile = Path.of("src", "test", "resources", "string-utils.jar");
Path outputDirectory = Path.of(System.getProperty("java.io.tmpdir"));
JarFileManager jarManager = new JarFileManager(jarFile);
Path outputExtraction = jarManager.extractTo(outputDirectory);
System.out.println(Files.exists(outputExtraction.resolve(Path.of("META-INF"))));
System.out.println(Files.exists(outputExtraction.resolve(Path.of("META-INF", "MANIFEST.MF"))));
System.out.println(Files.exists(outputExtraction.resolve(Path.of("wniemiec", "util", "java", "StringUtils.class"))));
Property | Type | Description | Default |
---|---|---|---|
isJarFile | (path: Path): boolean |
Checks whether a path is a JAR file. | - |
extractTo | (output: Path): Path |
Extracts JAR content to some location. | - |
Details about each version are documented in the releases section.
See the documentation on how you can contribute to the project here.
Name | Type | Description |
---|---|---|
dist | Directory |
Released versions |
docs | Directory |
Documentation files |
src | Directory |
Source files |