Skip to content

wniemiec-io-java/jar-file-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jar file manager

Utility for managing JAR files.

Coverage status Java compatibility Maven Central release License


❇ Introduction

Jar file manager performs operations with jar files simply and easily.

❓ How to use

  1. Add one of the options below to the pom.xml file:

Using Maven Central:

<dependency>
  <groupId>io.github.wniemiec-io-java</groupId>
  <artifactId>jar-file-manager</artifactId>
  <version>LATEST</version>
</dependency>
  1. Run
$ mvn install
  1. 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"))));

📖 Documentation

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. -

🚩 Changelog

Details about each version are documented in the releases section.

🤝 Contribute!

See the documentation on how you can contribute to the project here.

📁 Files

/

Name Type Description
dist Directory Released versions
docs Directory Documentation files
src Directory Source files