Accepts a File if its filename endsWith a specific string.
@param file The file to match
@return True if the File endsWith the specific string, otherwise false
325537
public boolean accept(File file) {
        if (caseSensitive) {
            return file.getName().endsWith(string0);
        } else {
            return file.getName().toLowerCase().endsWith(string0.toLowerCase());
        }
    }
669846
public boolean endsWith(final String str) {
        if (str == null) {
            return false;
        }
        final int len = str.length();
        if (len == 0) {
            return true;
        }
        if (len > size) {
            return false;
        }
        int pos = size - len;
        for (int i = 0; i < len; i++,pos++) {
            if (buffer[pos] != str.charAt(i)) {
                return false;
            }
        }
        return true;
    }
751758
public static boolean isSnapshotFile(File file) {
    checkNotNull(file, "file cannot be null");
    String fileName = file.getName();

    // The file name should contain an extension separator.
    if (fileName.lastIndexOf(EXTENSION_SEPARATOR) == -1) {
      return false;
    }

    // The file name should end with the snapshot extension.
    if (!fileName.endsWith("." + EXTENSION)) {
      return false;
    }

    // Parse the file name parts.
    String[] parts = fileName.substring(0, fileName.lastIndexOf(EXTENSION_SEPARATOR)).split(String.valueOf(PART_SEPARATOR));

    // The total number of file name parts should be at least 2.
    if (parts.length < 2) {
      return false;
    }

    // The second part of the file name should be numeric.
    // Subtract from the number of parts to ensure PART_SEPARATOR can be used in snapshot names.
    if (!isNumeric(parts[parts.length - 1])) {
      return false;
    }

    // Otherwise, assume this is a snapshot file.
    return true;
  }
199462
protected boolean isRelevant(String file) {
        if (mExcludes != null && mExcludes.matcher(file).find()) {
            return false;
        }
        if (mIncludes != null && !mIncludes.matcher(file).find()) {
            return false;
        }
        return true;
    }
513562
@Override
	public boolean accept(File file) {
		return file != null ? match(file.getName(), pattern) : false;
	}
2406
public boolean canParse(File file) {
		for(XParser parser : XParserRegistry.instance().getAvailable()) {
			if(parser.canParse(file)) {
				return true;
			}
		}
		return false;
	}
188600
public static Predicate<File> endsWithPredicate(final String suffix) {
    checkArgument(!suffix.isEmpty());

    return new EndsWithPredicate(suffix);
  }
520599
public boolean endsWith(String str, String suffix) {
        return (str == null || suffix == null) ? (str == suffix) :
            str.endsWith(suffix);
    }
200211
public boolean accept(File file) {
        if( !WatcherUtils.isInDirectory(file, javaSourceDir) || !WatcherUtils.hasExtension(file,"java")){
            return false;
        }

        // If the file has been deleted by may have been a controller, return true.
        // The cleanup will be applied.
        if (! file.isFile()) {
            return true;
        }

        //Parse the Java File and check if it's a wisdom Controller
        try {
            final CompilationUnit parse = JavaParser.parse(file);
            // The visitor return a Boolean object, potentially null.
            final Boolean accept = parse.accept(CLASS_VISITOR, null);
            return accept != null  && accept;
        } catch (Exception e) {
            getLog().error("Cannot parse  " + file.getAbsolutePath(), e);
            return false;
        }
    }
579930
public static boolean hasExtension(File file, String... extensions) {
        String extension = FilenameUtils.getExtension(file.getName());
        for (String s : extensions) {
            if (extension.equalsIgnoreCase(s) || ("." + extension).equalsIgnoreCase(s)) {
                return true;
            }
        }
        return false;
    }
832184
public static boolean isSegmentFile(String name, File file) {
    Assert.notNull(name, "name");
    Assert.notNull(file, "file");
    String fileName = file.getName();
    if (fileName.lastIndexOf(EXTENSION_SEPARATOR) == -1 || fileName.lastIndexOf(PART_SEPARATOR) == -1 || fileName.lastIndexOf(EXTENSION_SEPARATOR) < fileName.lastIndexOf(PART_SEPARATOR) || !fileName.endsWith(EXTENSION))
      return false;

    for (int i = fileName.lastIndexOf(PART_SEPARATOR) + 1; i < fileName.lastIndexOf(EXTENSION_SEPARATOR); i++) {
      if (!Character.isDigit(fileName.charAt(i))) {
        return false;
      }
    }

    if (fileName.lastIndexOf(PART_SEPARATOR, fileName.lastIndexOf(PART_SEPARATOR) - 1) == -1)
      return false;

    for (int i = fileName.lastIndexOf(PART_SEPARATOR, fileName.lastIndexOf(PART_SEPARATOR) - 1) + 1; i < fileName.lastIndexOf(PART_SEPARATOR); i++) {
      if (!Character.isDigit(fileName.charAt(i))) {
        return false;
      }
    }

    return fileName.substring(0, fileName.lastIndexOf(PART_SEPARATOR, fileName.lastIndexOf(PART_SEPARATOR) - 1)).equals(name);
  }
344924
public synchronized boolean needsReload(final File file) throws IOException {
        final long lastMod = file.lastModified();
        if (!file.exists()) {
            mtimes.remove(file);
        }
        final Long aLong = mtimes.get(file);
        return null == aLong || lastMod > aLong;
    }
79659
@Override
    public boolean matches(String fileName) {
        // Special case: if no classes or packages have been defined,
        // then the screener matches all class files.
        if (patternList.isEmpty()) {
            return true;
        }

        LOG.debug("Matching: {}", fileName);

        // Scan through list of regexes
        for (Matcher matcher : patternList) {
            matcher.reset(fileName);
            if (matcher.find()) {
                LOG.debug("\\tTrying [{}]: yes!", matcher.pattern());
                return true;
            }
            LOG.debug("\\tTrying [{}]: no", matcher.pattern());
        }
        return false;
    }
77954
public function accept( File $file ) : bool
    {
        if ( $this->extension ){
            $ext = $file->getExtension();
            if ( $ext != $this->extension ){
                return FALSE;
            }
        }

        $suffix = $this->extension ? '.' . $this->extension : NULL;
        $name = $suffix ? $file->getName($suffix) : $file->getName();

        if ( preg_match( $this->pattern, $name ) ){
            return TRUE;
        }

        return FALSE;
    }
1259391
private void setEndFileMarkerFile(String fileName) {
    int fileIndex = parseFileIndex(fileName);
    if (endFileNumber == -1) {
      // First time finding the end-marker file.
      endFileNumber = fileIndex;
      logger.atInfo().log("Found end-marker file '%s' with index %s", fileName, endFileNumber);

      // Sanity-check known filenames against the endFileNumber.
      for (String knownFile : knownFileSet) {
        int knownFileIndex = parseFileIndex(knownFile);
        Preconditions.checkState(
            knownFileIndex <= endFileNumber,
            "Found known file '%s' with index %s, which isn't less than or "
                + "equal to than endFileNumber %s!",
            knownFile, knownFileIndex, endFileNumber);
      }
    } else {
      // If we found it before, make sure the file we're looking at has the same index.
      Preconditions.checkState(fileIndex == endFileNumber,
          "Found new end-marker file '%s' with index %s but already have endFileNumber %s!",
          fileName, fileIndex, endFileNumber);
    }
  }
1100193
public static boolean endsWith(CharSequence buf, CharSequence end) {
    int len = end.length(), start = buf.length() - len;
    if(start < 0) {
      return false;
    }
    for(int i = 0; i < len; i++, start++) {
      if(buf.charAt(start) != end.charAt(i)) {
        return false;
      }
    }
    return true;
  }
83229
public final boolean isFileAllowedForPreprocessing(@Nullable final File file) {
    boolean result = false;
    if (file != null && file.isFile() && file.length() != 0L) {
      result = this.extensions.contains(PreprocessorUtils.getFileExtension(file));
    }
    return result;
  }