Package org.brijframework.util.resouces
Class ResourcesUtil
- java.lang.Object
-
- org.brijframework.util.resouces.ResourcesUtil
-
public class ResourcesUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description ResourcesUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleandirCreate(String dir)static List<Class<?>>findClasses(File directory, String packageName)Recursive method used to find all classes in a given directory and subdirs.static Collection<? extends File>findCurrentFiles(File directory, String... extesions)static Collection<? extends File>findFiles(File directory, String... extesions)static Class<?>[]getClasses()static Class<?>[]getClasses(ClassLoader classLoader)Scans all classes accessible from the context class loader which belong to the given package and subpackages.static Class<?>[]getClasses(String packageName)Scans all classes accessible from the context class loader which belong to the given package and subpackages.static Collection<? extends File>getCurrentResources(ClassLoader classLoader, String path, String extesions)static Collection<? extends File>getCurrentResources(String path, String extesions)static List<Object>getLisFromJsonFile(String dir)static List<Object>getListFromOBJFile(String beans)static List<Object>getListFromPersistFile(String dir)static List<Object>getListFromXMLFile(String dir)static Map<String,Object>getMapFromJsonFile(String filePath)static List<Object>getMapFromOBJFile(String beans)static Map<String,Object>getMapFromXMLFile(String filePath)static ObjectgetObjectFromPersistFile(String beans)static URLgetResource(String path)static URLgetResourceJar(String path)static List<File>getResources(ClassLoader classLoader, String path, String... extesions)static List<File>getResources(String path, String... extesions)static ArrayListloadFilesFromJarOrDirectly(String dirPath, URL dirUrl)
-
-
-
Method Detail
-
getCurrentResources
public static Collection<? extends File> getCurrentResources(String path, String extesions) throws IOException
- Throws:
IOException
-
getCurrentResources
public static Collection<? extends File> getCurrentResources(ClassLoader classLoader, String path, String extesions) throws IOException
- Throws:
IOException
-
findCurrentFiles
public static Collection<? extends File> findCurrentFiles(File directory, String... extesions)
-
getResources
public static List<File> getResources(ClassLoader classLoader, String path, String... extesions) throws IOException
- Throws:
IOException
-
getResources
public static List<File> getResources(String path, String... extesions) throws IOException
- Throws:
IOException
-
findFiles
public static Collection<? extends File> findFiles(File directory, String... extesions)
-
getClasses
public static Class<?>[] getClasses(String packageName) throws ClassNotFoundException, IOException
Scans all classes accessible from the context class loader which belong to the given package and subpackages.- Parameters:
packageName- The base package- Returns:
- The classes
- Throws:
ClassNotFoundExceptionIOException
-
findClasses
public static List<Class<?>> findClasses(File directory, String packageName) throws ClassNotFoundException
Recursive method used to find all classes in a given directory and subdirs.- Parameters:
directory- The base directorypackageName- The package name for classes found inside the base directory- Returns:
- The classes
- Throws:
ClassNotFoundException
-
getClasses
public static Class<?>[] getClasses(ClassLoader classLoader)
Scans all classes accessible from the context class loader which belong to the given package and subpackages.- Parameters:
packageName- The base package- Returns:
- The classes
- Throws:
ClassNotFoundExceptionIOException
-
getClasses
public static Class<?>[] getClasses()
-
loadFilesFromJarOrDirectly
public static ArrayList loadFilesFromJarOrDirectly(String dirPath, URL dirUrl)
-
dirCreate
public static boolean dirCreate(String dir)
-
-