Package com.evolveum.midpoint.util
Class ClassPathUtil
- java.lang.Object
-
- com.evolveum.midpoint.util.ClassPathUtil
-
public class ClassPathUtil extends Object
Various class path, class loading and class scanning utilities. For more info about class-path scanning: https://github.com/classgraph/classgraph
-
-
Constructor Summary
Constructors Constructor Description ClassPathUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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.static Set<Class<?>>
listClasses(Package pkg)
static Set<Class<?>>
listClasses(String packageName)
static Collection<Class<?>>
scanClasses(Class<? extends Annotation> annotationClass)
static void
searchClasses(String packageName, Consumer<Class<?>> consumer)
-
-
-
Field Detail
-
LOGGER
public static final Trace LOGGER
-
-
Method Detail
-
scanClasses
public static Collection<Class<?>> scanClasses(Class<? extends Annotation> annotationClass)
-
extractFileFromClassPath
public static boolean extractFileFromClassPath(String src, String dst)
Extract specified source on class path to file system dst- Parameters:
src
- sourcedst
- destination- Returns:
- successful extraction
-
copyFile
public static boolean copyFile(InputStream srcStream, String srcName, String dstPath)
-
copyFile
public static boolean copyFile(InputStream srcStream, String srcName, File dstFile)
-
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
-
-