Package rife.bld.extension.tools
Class ClasspathTools
java.lang.Object
rife.bld.extension.tools.ClasspathTools
Classpath Tools.
Utility methods for assembling classpath strings from file and string
path entries. null arrays, null collections, and null
or blank individual entries are silently ignored in all methods.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringjoinClasspath(@Nullable String... paths) Joins string paths into a single classpath by concatenating non-blank paths using the system's path separator.static StringjoinClasspath(@Nullable Collection<File>... files) Joins multiple collections of files into a single classpath string using the system's path separator.
-
Method Details
-
joinClasspath
Joins string paths into a single classpath by concatenating non-blank paths using the system's path separator.Blank or
nullpaths are ignored.- Parameters:
paths- an array of strings representing individual classpath entries; may benull, and individualnullor blank strings are silently skipped- Returns:
- a string representing the concatenated classpath entries, separated by the system's path separator; an empty string if no valid paths are provided
- Since:
- 1.0
-
joinClasspath
Joins multiple collections of files into a single classpath string using the system's path separator.Each file's normalized absolute path from all provided collections is included in the resulting classpath string.
nullcollections andnullindividual file elements are silently ignored.Uses
Path.toAbsolutePath()followed byPath.normalize()to resolve relative paths and eliminate redundant..and.segments.- Parameters:
files- variable number ofCollections ofFileobjects representing the files to include in the classpath; may benull, andnullcollections or elements are skipped- Returns:
- a classpath string where the normalized absolute paths of all provided files are joined by the system's path separator; an empty string if no valid files are provided
- Since:
- 1.0
-