Package com.github.toolarium.common.util
Class ClassPathUtil
java.lang.Object
com.github.toolarium.common.util.ClassPathUtil
Class path util
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classThis class holds the class names -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckClassByName(String className) Check if a given class is in the class pathReturns a list of all the class paths in the current VM.static ClassPathUtilGet the instancesearchArchiveByName(String archiveName) Search an archivesearchArchiveByRegExp(String regExp) Search archive by regular expressionsearchClassByName(String className) Search a specific classsearchClassByPackageName(String packageName) Search classes from a specific packagesearchClassByRegExp(String regExp) Search class by regular expressionsearchFileByRegExp(String regExp) Search file by regular expressionsearchFileByRegExpAsURLList(String regExp) Search file by regular expression
-
Method Details
-
getInstance
Get the instance- Returns:
- the instance
-
searchArchiveByName
Search an archive- Parameters:
archiveName- the archive to search- Returns:
- the full archive path ot null if it does not exist
-
searchArchiveByRegExp
Search archive by regular expression- Parameters:
regExp- the search regular expression- Returns:
- a list with full qualified class names or null if it does not exist
-
searchClassByName
Search a specific class- Parameters:
className- the name of the class with or without package name- Returns:
- a list with full qualified class names or null if it does not exist
-
searchClassByRegExp
Search class by regular expression- Parameters:
regExp- the search regular expression- Returns:
- a list with full qualified class names or null if it does not exist
-
searchClassByPackageName
Search classes from a specific package- Parameters:
packageName- the name of the package- Returns:
- a list with full qualified class names or null if it does not exist
-
checkClassByName
Check if a given class is in the class path- Parameters:
className- the name of the class with or without package name- Returns:
- true if the class exists; otherwise false
-
searchFileByRegExp
Search file by regular expression- Parameters:
regExp- the search regular expression- Returns:
- a list with full qualified class names or null if it does not exist
-
searchFileByRegExpAsURLList
Search file by regular expression- Parameters:
regExp- the search regular expression- Returns:
- a list with full qualified class names or null if it does not exist
-
getClassPaths
Returns a list of all the class paths in the current VM.- Returns:
- the class paths in current vm
-