Home
Categories
Dictionary
Download
Project Details
Changes Log
FAQ
License

Utility classes



This article presents several Utility classes provided by the library:
  • The DependencyPrinter class allows to print the list of dependencies from one JarDependency and another
  • The JavaModulesUtilities class allows to check that one or several Jar files are compatible with the Java module system
  • The CompactProfiles class allows to check that one Jar file is compatible with a specific Java compact profile (from compact1 to compact3)
  • The JarManifestUtilities class allows to check that the jar files declared in the Class-Path attribute in a Jar file Manifest exist

DependencyPrinter

The DependencyPrinter class allows to print the list of dependencies from one JarDependency and another.

For example:
   JarDependencies depend = new JarDependencies(<myJarFile>);
   JarDependencies anotherDepend = new JarDependencies(<aSecondJarFile>);
   DependencyPrinter.printDependencies(depend, anotherDepend);
This class can also be used to print the dependencies with JavaFX or Swing. For example:
   JarDependencies depend = new JarDependencies(<myJarFile>);
   DependencyPrinter.printSwingDependencies(depend); // for Swing classes
   DependencyPrinter.printJavaFXDependencies(depend); // for JavaFX classes      

Java module system compatibility


The JavaModulesUtilities class allows to check that one or several Jar files are compatible with the Java module system.

For example:
  JarDependencies depend = new JarDependencies(<myJarFile>);
  boolean isCompatible = JavaModulesUtilities.isModulesCompatible(depend);

Compact profiles

The CompactProfiles class allows to check that one Jar file is compatible with a specific Java compact profile (from compact1 to compact3). See here for more information about Java compact profiles.

For example:
  JarDependencies depend = new JarDependencies(<myJarFile>);
  boolean isCompatible = CompactProfiles.isCompatible(myJarFile, 2);

JarManifestUtilities

Main Article: JarManifestUtilities

The JarManifestUtilities class allows to check that the jar files declared in the Class-Path attribute in a Jar file Manifest exist. There are two ways to use this class:
  • A basic way allowing to get the list of Jar files referenced in the Manifest
  • A simpler way allowing to check that the Jar files referenced in the Manifest are those intended to be references
For example:
  List<URL> list = JarManifestUtilities.getDependencies(<myJarFile>);

Categories: general

Copyright 2019 Herve Girod. All Rights Reserved. Documentation and source under the LGPL v2 licence