Class ResourceHelper


  • public class ResourceHelper
    extends java.lang.Object
    Utility that provide classPath scan to retrieve resources
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Collection<java.io.File> getFileResourcesByExtension​(java.lang.String extension)
      Scan into classpath folders to find resources with the required extension
      static java.util.Collection<java.io.File> getFileResourcesFromDirectory​(java.io.File directory, java.util.regex.Pattern pattern)
      Scan folder to find resources that match with pattern
      static java.util.Collection<java.lang.String> getResourcesByExtension​(java.lang.String extension)
      Scan into classpath folders to find resources with the required extension
      static java.util.Collection<java.lang.String> getResourcesFromDirectory​(java.io.File directory, java.util.regex.Pattern pattern)
      Scan folder to find resources that match with pattern
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getFileResourcesByExtension

        public static java.util.Collection<java.io.File> getFileResourcesByExtension​(java.lang.String extension)
        Scan into classpath folders to find resources with the required extension
        Parameters:
        extension - to find
        Returns:
        stream of matching resources
      • getResourcesByExtension

        public static java.util.Collection<java.lang.String> getResourcesByExtension​(java.lang.String extension)
        Scan into classpath folders to find resources with the required extension
        Parameters:
        extension - to find
        Returns:
        stream of matching resources
      • getFileResourcesFromDirectory

        public static java.util.Collection<java.io.File> getFileResourcesFromDirectory​(java.io.File directory,
                                                                                       java.util.regex.Pattern pattern)
        Scan folder to find resources that match with pattern
        Parameters:
        directory - where to start the search
        pattern - to find
        Returns:
        stream of matching resources
      • getResourcesFromDirectory

        public static java.util.Collection<java.lang.String> getResourcesFromDirectory​(java.io.File directory,
                                                                                       java.util.regex.Pattern pattern)
        Scan folder to find resources that match with pattern
        Parameters:
        directory - where to start the search
        pattern - to find
        Returns:
        stream of matching resources