public static File[] getFilesInDirectoryByPattern(String dirPath, final Pattern pattern) {
    File distDir = new File(dirPath);
    File[] files = distDir.listFiles((dir, name) -> pattern.matcher(name).matches());
    return files != null ? files : new File[0];
  }
public static File[] getFilesInDirectoryByPattern(String dirPath, final Pattern pattern)