Package com.evolveum.midpoint.util
Class ClassPathUtil
- java.lang.Object
-
- com.evolveum.midpoint.util.ClassPathUtil
-
public class ClassPathUtil extends Object
- Author:
- Peter Prochazka, Radovan Semancik, Viliam Repan (lazyman)
-
-
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 void
searchClasses(String packageName, Consumer<Class> consumer)
This is not entirely reliable method.
-
-
-
Field Detail
-
LOGGER
public static final Trace LOGGER
-
-
Method Detail
-
searchClasses
public static void searchClasses(String packageName, Consumer<Class> consumer)
This is not entirely reliable method. Maybe it would be better to rely on Spring ClassPathScanningCandidateComponentProvider
-
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
-
-