pekko-connectors-sample-ftp-to-file/src/main/java/playground/filesystem/impl/NameEqualsPathFilter.java [11:28]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class NameEqualsPathFilter implements DirectoryStream.Filter<Path> {

  private String nameToMatch;

  private boolean caseInsensitive = false;

  public NameEqualsPathFilter(final String nameToMatch,
                              final boolean caseInsensitive) {
    this.nameToMatch = nameToMatch;
    this.caseInsensitive = caseInsensitive;
  }

  @Override
  public boolean accept(Path entry) throws IOException {
    if (caseInsensitive) {
     return entry.getFileName().toString().equalsIgnoreCase(nameToMatch);
    } else {
      return entry.getFileName().toString().equals(nameToMatch);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



pekko-connectors-sample-rotate-logs-to-ftp/src/main/java/playground/filesystem/impl/NameEqualsPathFilter.java [11:28]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class NameEqualsPathFilter implements DirectoryStream.Filter<Path> {

  private String nameToMatch;

  private boolean caseInsensitive = false;

  public NameEqualsPathFilter(final String nameToMatch,
                              final boolean caseInsensitive) {
    this.nameToMatch = nameToMatch;
    this.caseInsensitive = caseInsensitive;
  }

  @Override
  public boolean accept(Path entry) throws IOException {
    if (caseInsensitive) {
     return entry.getFileName().toString().equalsIgnoreCase(nameToMatch);
    } else {
      return entry.getFileName().toString().equals(nameToMatch);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



