Class ResourceFolderUtil

java.lang.Object
com.vaadin.flow.internal.ResourceFolderUtil

public final class ResourceFolderUtil extends Object
Lists the files in a folder on the classpath, wherever the folder lives.

A folder has no content of its own to read, so its files have to be listed, which depends on whether the folder is a folder on the file system, an entry in a jar or something an application server serves through a protocol of its own.

For internal use only. May be renamed or removed in a future release.

Since:
25.3
  • Method Details

    • visitFiles

      public static void visitFiles(URL folder, ResourceFolderUtil.FolderFileVisitor visitor) throws IOException
      Visits the files directly inside the given folder on the classpath.

      Folders inside the folder are not visited, and neither are the files in them.

      Parameters:
      folder - the folder to visit the files of, as a class loader reports it
      visitor - called for each file in the folder
      Throws:
      IOException - if the folder cannot be listed, for example because it is not an existing folder