public class GlobRegExpMatching extends Object implements RegularExpressionMatching
Implements the RegularExpressionMatching Interface.
matchFileNamesWithPattern performs a Glob regular expression pattern match on the Files passed to it, using fileNameRegExp, then returns the ones that match.Code example:
File f=new File("c:\\homefolder");
File[] someFiles;
List files in folder f and store in someFiles.
someFiles=f.listFiles();
Find the '.doc' files in someFiles that have 'rfc' in their name.
String[] matchedFiles=matchFileNamesWithPattern(someFiles, "*rfc*.doc");
matchFilesWithPattern performs a Glob regular expression pattern match on the SftpFiles passed to it, using fileNameRegExp, then returns the ones that match.
| Constructor and Description |
|---|
GlobRegExpMatching() |
| Modifier and Type | Method and Description |
|---|---|
String[] |
matchFileNamesWithPattern(File[] files,
String pattern)
compiles pattern into a regular expression and pattern
matches on each file's name, and returns those that match.
|
SftpFile[] |
matchFilesWithPattern(SftpFile[] files,
String pattern)
compiles pattern into a regular expression and pattern
matches on each file's name, and returns those that match.
|
public String[] matchFileNamesWithPattern(File[] files, String pattern) throws SshException
matchFileNamesWithPattern in interface RegularExpressionMatchingfiles - pattern - SshExceptionpublic SftpFile[] matchFilesWithPattern(SftpFile[] files, String pattern) throws SftpStatusException, SshException
matchFilesWithPattern in interface RegularExpressionMatchingfiles - fileNameRegExp - SftpStatusExceptionSshExceptionCopyright © 2025. All rights reserved.