Package com.evolveum.midpoint.util
Class ClassPathUtil
java.lang.Object
com.evolveum.midpoint.util.ClassPathUtil
Various class path, class loading and class scanning utilities.
For more info about class-path scanning: https://github.com/classgraph/classgraph
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
copyFile
(InputStream srcStream, String srcName, File dstFile) static boolean
copyFile
(InputStream srcStream, String srcName, OutputStream dstStream, String dstName) static boolean
copyFile
(InputStream srcStream, String srcName, String dstPath) static boolean
extractFileFromClassPath
(String src, String dst) Extract specified source on class path to file system dststatic boolean
extractFilesFromClassPath
(String srcPath, String dstPath, boolean overwrite) Extracts all files in a directory on a classPath (system resource) to a directory on a file system.listClasses
(Package pkg) listClasses
(String... packageNames) static Collection<Class<?>>
scanClasses
(Class<? extends Annotation> annotationClass, String packageNames) static Collection<Class<?>>
scanClasses
(Class<? extends Annotation> annotationClass, String... packageNames)
-
Field Details
-
LOGGER
-
DEFAULT_PACKAGE_TO_SCAN
- See Also:
-
-
Constructor Details
-
ClassPathUtil
public ClassPathUtil()
-
-
Method Details
-
listClasses
-
listClasses
-
scanClasses
public static Collection<Class<?>> scanClasses(Class<? extends Annotation> annotationClass, String packageNames) -
scanClasses
public static Collection<Class<?>> scanClasses(Class<? extends Annotation> annotationClass, String... packageNames) -
extractFileFromClassPath
Extract specified source on class path to file system dst- Parameters:
src
- sourcedst
- destination- Returns:
- successful extraction
-
copyFile
-
copyFile
-
copyFile
public static boolean copyFile(InputStream srcStream, String srcName, OutputStream dstStream, String dstName) -
extractFilesFromClassPath
public static boolean extractFilesFromClassPath(String srcPath, String dstPath, boolean overwrite) throws URISyntaxException, IOException Extracts all files in a directory on a classPath (system resource) to a directory on a file system.- Throws:
URISyntaxException
IOException
-