Class ClassPathUtils

java.lang.Object
com.regnosys.rosetta.common.util.ClassPathUtils

public class ClassPathUtils extends Object
  • Constructor Details

    • ClassPathUtils

      public ClassPathUtils()
  • Method Details

    • findPathsFromClassPath

      public static List<Path> findPathsFromClassPath(Collection<String> classPathDirectories, String includeRegex, Optional<String> excludeRegex, ClassLoader classLoader)
      Searches the class path for given directories and returns all files contained in the directory and sub directories filtered by the regexes.
      Parameters:
      classPathDirectories - List of all the directories to search for in the class path loader.
      includeRegex - Regex file pattern to search files on.
      excludeRegex - Regex file pattern to exclude files on.
      classLoader - Classloader to search in.
      Returns:
    • findRosettaFilePaths

      public static List<Path> findRosettaFilePaths()
    • findStaticRosettaFilePaths

      public static List<Path> findStaticRosettaFilePaths()
      Includes basictypes.rosetta and annotations.rosetta
    • expandPaths

      public static List<Path> expandPaths(Collection<Path> paths, String includeRegex, Optional<String> excludeRegex)
    • getResource

      public static URL getResource(Path path)
    • getResource

      public static URL getResource(Path path, ClassLoader classLoader)
    • loadFromClasspath

      public static Stream<Path> loadFromClasspath(String path)
    • loadFromClasspath

      public static Stream<Path> loadFromClasspath(String path, ClassLoader classLoader)
    • loadSingleFromClasspath

      public static Path loadSingleFromClasspath(String path)
    • loadSingleFromClasspath

      public static Path loadSingleFromClasspath(String path, ClassLoader classLoader)