Make a predicate to test files for their name ending with the specified suffix.

@param suffix May not be null or empty.
188600
public static Predicate<File> endsWithPredicate(final String suffix) {
    checkArgument(!suffix.isEmpty());

    return new EndsWithPredicate(suffix);
  }
238429
def _is_suffix(self, t):
        """"""
        return t not in NOT_SUFFIX and (t.replace('.', '') in SUFFIXES or t.replace('.', '') in SUFFIXES_LOWER)
1167305
public static String removeSuffix(String filename, String suffix) {
    if (filename.endsWith(suffix)) {
      return filename.substring(0, filename.length() - suffix.length());
    }
    return filename;
  }
888059
public function addFilenameSuffix($suffix)
    {
        $path                 = $this->fi->getPath();
        $ext                  = $this->fi->getExtension();
        $nameWithoutExtension = preg_replace('/\.' . $ext . '$/', '', $this->fi->getFilename());
        $this->fi             = new \SplFileInfo(sprintf('%s/%s%s.%s', $path, $nameWithoutExtension, $suffix, $ext));
        return $this;
    }
1269139
def suffix(filename,suffix):
    '''  '''
    return os.path.split(re.sub(_afni_suffix_regex,"%s\g<1>" % suffix,str(filename)))[1]
333456
public InstructionFileId instructionFileId(String suffix) {
        String ifileKey = key + DOT;
        ifileKey += (suffix == null || suffix.trim().length() == 0)
                  ? DEFAULT_INSTRUCTION_FILE_SUFFIX
                  : suffix
                  ;
         return new InstructionFileId(bucket, ifileKey, versionId);
    }
1267912
private static URI addSuffix(final URI href, final String suffix) {
        return URI.create(addSuffix(href.toString(), suffix));
    }
1148826
private static function suffixName(string $name, string $suffix)
    {
        return \substr($name, -\strlen($suffix)) === $suffix ? $name : \sprintf('%s%s', $name, $suffix);
    }
1006201
def add_suffix(file_path, suffix):
    """"""
    split = os.path.basename(file_path).rsplit('.', 1)
    ext = split[1]
    name = split[0]
    out = str(name + '_' + suffix + '.' + ext)
    return os.path.join(os.path.dirname(file_path), out)
513103
@Override
	public boolean matchPath(String path) {

		boolean match = false;
		if (StringUtils.isNotEmpty(path)) {
			match = path.endsWith(suffix);
		}
		return match;
	}
747087
@Override
	public boolean apply(final URI uri) {
		String file = uri.getRawPath().toLowerCase();
		for (String suffix: suffixes) if (file.endsWith(suffix)) return true;
		return false;
	}
394696
public static function getNewFileName($fileName, $prefix, $suffix)
    {
        $effect = $fileName;

        if (!empty($fileName) && (!empty($prefix) || !empty($suffix))) {
            $name = self::getFileNameWithoutExtension($fileName);
            $extension = self::getFileExtension($fileName);

            $effect = sprintf('%s%s%s.%s', $prefix, $name, $suffix, $extension);
        }

        return $effect;
    }
134072
def add_suffix(path, suffix=""):
    """"""
    return join(dirname(path), basename(path, ext=False) + suffix + extname(path))
830200
public static void renameFiles(File[] filePath, String prefix, String suffix, int start) {
        String[] fileNames = new String[filePath.length];
        for (int i = 0; i < fileNames.length; i++) {
            fileNames[i] = prefix + (start++) + suffix;
        }
        renameFiles(filePath, fileNames);
    }
222056
public static boolean isExtensionWellFormated(File file, String prefix) {
        String path = file.getAbsolutePath();
        String extension = "";
        int i = path.lastIndexOf('.');
        if (i >= 0) {
            extension = path.substring(i + 1);
        }
        return extension.equalsIgnoreCase(prefix);
    }
532515
private function stringEndsWith(string $string, string $suffix): bool
    {
        return substr($string, -strlen($suffix)) === $suffix;
    }
586147
public AVIMConversationsQuery whereEndsWith(String key, String suffix) {
    conditions.whereEndsWith(key, suffix);
    return this;
  }