Skip to content

Small tool to recursively search directories for files or files and folders where the name matches a regexp and retuns a list of files.

License

Notifications You must be signed in to change notification settings

brajjan79/FilesFinder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java CI with Maven Codacy Badge Codacy Badge JitPack

FilesFinder

JAVA plugin to search on local harddisk for files and directories where the name is matching a provided regexp and then returns a list of the found files.

Usage

The search string may contain any regexp or word to match. This enables the coder to select if a name should start with, contain or end with or simple be formatted in a specific way. With regexps this could also be used to match files that does not contain "xxx" or well anything you may use regexps to match.

Imports:

import java.io.File;
import com.github.brajjan79.filesfinder.FilesFinder

Code:

File someBaseDir = new File("path/to/dir");
String searchRegex = "test"

File[] foundFiles = FilesFinder.find(searchRegex, someBaseDir)

--> '"foundFiles" will contain all files with "test" in the name'

recursive = false;
File[] foundFiles = FilesFinder.find(searchRegex, someBaseDir, recursive)

--> '"foundFiles" will contain all files with "test" in the name in the provided base directory'

recursive = true;
File[] foundFiles = FilesFinder.findAll(searchRegex, someBaseDir, recursive)

--> '"foundFiles" will contain all files and directories with "test" in the name in the provided base directory'

Installation

Recommended is to install the tool via a dependency manager like Maven or Gradle. The source data can be downloaded here: https://github.com/brajjan79/FilesFinder/tags

Maven, Gradle etc

See Jitpack: https://jitpack.io/#brajjan79/FilesFinder

About

Small tool to recursively search directories for files or files and folders where the name matches a regexp and retuns a list of files.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages