public class

FileFinder

extends Object
java.lang.Object
   ↳ org.ops4j.pax.exam.spi.war.FileFinder

Class Overview

Finds files matching a given filter in a given directory tree.

Summary

Public Methods
static File findFile(File rootDir, String fileName)
Finds a file with the given name in the given root directory or any subdirectory.
static File findFile(File rootDir, FilenameFilter filter)
Finds a file matching the given file name filter in the given root directory or any subdirectory.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static File findFile (File rootDir, String fileName)

Finds a file with the given name in the given root directory or any subdirectory. The files and directories are scanned in alphabetical order, so the result is deterministic.

The method returns the first matching result, if any, and ignores all other matches.

Parameters
rootDir root directory
fileName exact file name, without any wildcards
Returns
  • matching file, or null

public static File findFile (File rootDir, FilenameFilter filter)

Finds a file matching the given file name filter in the given root directory or any subdirectory. The files and directories are scanned in alphabetical order, so the result is deterministic.

The method returns the first matching result, if any, and ignores all other matches.

Parameters
rootDir root directory
filter file name filter
Returns
  • matching file, or null