JarDependencies is simply by using the JarDependencies(File) method, and provide a directory containing classes, or one jar file:File myJarFile = "D:/Java/libraries/theJarFile.jar"; JarDependencies depend = new JarDependencies(myJarFile);
JarDependencies by specifying a directory and using a file name pattern, by using one of the following methods:myFile-1.2.4.jar for examplemyFile.jar for example([a-zA-Z]|[a-zA-Z_][a-zA-Z_\-0-9]*)[a-zA-Z_0-9]
File myDirectory = "D:/Java/libraries"; JarDependencies depend = new JarDependencies(myDirectory, "theJarFile", false);This method has the following arguments
.jar or .zip extension.jar or .zip extension which are children files in the directory:true>rootname>-[0-9a-zA-Z]*([\-0-9a-zA-Z\.]*)?(\.jar|\.zip)File myDirectory = "D:/Java/libraries"; JarDependencies depend = new JarDependencies(myDirectory, "theJarFile", false, NamePatternSeparator.UNDERSCORE);This method has the following arguments
.jar or .zip extension.jar or .zip extension which are children files in the directory:true>rootname>_[0-9a-zA-Z]*([_0-9a-zA-Z\.]*)?(\.jar|\.zip)-- library ---- test.jar ---- test2-2.3.4.jar
JarDependency depend = new JarDependencies(new File(<lib directory>, "test.jar")) will return the JarDependencies for the library/test.jar fileJarDependencies depend = new JarDependencies(new File(<lib directory>,"test2-2.3.4.jar")) will return the JarDependencies for the library/test2-2.3.4.jar fileJarDependencies depend = new JarDependencies(new File(<lib directory>,"test2.jar")) will throw an IOException-- library ---- test.jar ---- test2-2.3.4.jar ---- test3-2.3.4b1.jar ---- test4-2.4.6-Snapshot.jar
JarDependencies depend = new JarDependencies(<lib directory>, "test", true) will return the JarDependencies for the library/test.jar fileJarDependencies depend = new JarDependencies(<lib directory>, "test2", false) will return the JarDependencies for the library/test2-2.3.4.jar fileJarDependencies depend = new JarDependencies(<lib directory>, "test3", false) will return the JarDependencies for the library/test3-2.3.4b1.jar fileJarDependencies depend = new JarDependencies(<lib directory>, "test4", false) will return the JarDependencies for the library/test4-2.4.6-Snapshot.jar fileJarDependencies depend = new JarDependencies(<lib directory>, "test5", false) will throw an IOException-- library ---- test.jar ---- test2_2.3.4.jar ---- test3_2.3.4b1.jar ---- test4_2.4.6_Snapshot.jar
JarDependencies depend = new JarDependencies(<lib directory>, "test", true, NamePatternSeparator.UNDERSCORE) will return the JarDependencies for the library/test.jar fileJarDependencies depend = new JarDependencies(<lib directory>, "test2", false, NamePatternSeparator.UNDERSCORE) will return the JarDependencies for the library/test2_2.3.4.jar fileJarDependencies depend = new JarDependencies(<lib directory>, "test3", false, NamePatternSeparator.UNDERSCORE) will return the JarDependencies for the library/test3_2.3.4b1.jar fileJarDependencies depend = new JarDependencies(<lib directory>, "test4", false, NamePatternSeparator.UNDERSCORE) will return the JarDependencies for the library/test4_2.4.6_Snapshot.jar filemyFile-1.2.4.jar for examplemyFile.jar for exampleCopyright 2019 Herve Girod. All Rights Reserved. Documentation and source under the LGPL v2 licence