Class ResourceWalker

java.lang.Object
clazzfish.core.ResourceWalker

public class ResourceWalker extends Object
his class scans a sub directory for a given suffix. It is a re-implentation of the ResourceWalker in the monitor package but without dependencies to commons-io.
Since:
3.0 (26.09.25)
Author:
oboehm
  • Constructor Details

    • ResourceWalker

      public ResourceWalker(File dir)
      Instantiates a new Resource walker for all resources.
      Parameters:
      dir - the start dir
    • ResourceWalker

      public ResourceWalker(File dir, String suffix)
      Instantiates a new resource walker for resources with the given suffix.
      Parameters:
      dir - the start dir
      suffix - file suffix, e.g. ".xml"
  • Method Details

    • getResources

      public Collection<String> getResources() throws IOException
      Walk thru the directories and return all found file resources.
      Returns:
      a collection of resources
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getClasses

      public Collection<String> getClasses() throws IOException
      Walk thru the directories and return all class files as classname, e.g. a file java/lang/String.class is returned as "java.lang.String".
      Returns:
      a collection of classnames
      Throws:
      IOException - Signals that an I/O exception has occurred.