Return File(s) in dirName that match suffix.
@param dirName
@param suffix
@return
18251
static private File[] finder( String dirName, final String suffix){
		if (null == dirName || null == suffix) {
			return null;
		}

		final File dir = new File(dirName);
		return dir.listFiles(new FilenameFilter() {
			@Override
			public boolean accept(File dir, String filename)
			{ return filename.endsWith(suffix); }
		} );
	}
550057
public static String getFileExtension(final String fileName) {
        if (fileName == null) return null;

        final int lastPeriodIndex = fileName.lastIndexOf(".");
        // make sure there is an extension, and that the filename doesn't end with a period
        if (lastPeriodIndex != -1 && lastPeriodIndex < fileName.length() - 1) {
            final String extension = fileName.substring(lastPeriodIndex + 1);
            return extension;
        }

        return null;
    }
414367
public int get(String suffix)
    {
        suffix = reverse(suffix);
        Integer length = trie.get(suffix);
        if (length == null) return 0;

        return length;
    }
864308
public function uniqueName($dir, $name, $suffix = ' copy', $checkNum=true) {
		$ext  = '';

		if (preg_match('/\.((tar\.(gz|bz|bz2|z|lzo))|cpio\.gz|ps\.gz|xcf\.(gz|bz2)|[a-z0-9]{1,4})$/i', $name, $m)) {
			$ext  = '.'.$m[1];
			$name = substr($name, 0,  strlen($name)-strlen($m[0]));
		} 
		
		if ($checkNum && preg_match('/('.$suffix.')(\d*)$/i', $name, $m)) {
			$i    = (int)$m[2];
			$name = substr($name, 0, strlen($name)-strlen($m[2]));
		} else {
			$i     = 1;
			$name .= $suffix;
		}
		$max = $i+100000;

		while ($i <= $max) {
			$n = $name.($i > 0 ? $i : '').$ext;

			if (!$this->stat($this->_joinPath($dir, $n))) {
				$this->clearcache();
				return $n;
			}
			$i++;
		}
		return $name.md5($dir).$ext;
	}
68106
def prefix(filename):
    '''  '''
    return os.path.split(re.sub(_afni_suffix_regex,"",str(filename)))[1]
1213948
def get_hashed_filename(name, file, suffix=None):
    
    basename, hash, ext = split_filename(name)
    file.seek(0)
    new_hash = '.%s' % md5(file.read()).hexdigest()[:12]
    if suffix is not None:
        basename = '%s_%s' % (basename, suffix)
    return '%s%s%s' % (basename, new_hash, ext)
475939
private static File[] getAllFiles(String dirName) {

    File dir = new File(dirName);

    File[] files = dir.listFiles(); // returns files and folders

    if (files != null) {
      List<File> filteredFiles = new ArrayList<File>();
      for (File file : files) {

        if (file.isFile()) {
          filteredFiles.add(file);
        }
      }
      return filteredFiles.toArray(new File[filteredFiles.size()]);
    } else {
      System.out.println(dirName + " does not denote a valid directory!");
      return new File[0];
    }
  }
501999
public static File createMediaFile(String dirName) {
        String timeStamp = IMG_FILE_NAME_FORMAT.format(new Date());
        String imageFileName = PREFIX_IMAGE + timeStamp + EXTENSION_JPEG;
        return new File(getMediaDir(dirName), imageFileName);
    }
653120
public static String createEndSuffixFileName(String fileName, String endSuffix) {
        int    index       = fileName.lastIndexOf(".");
        String preFileName = fileName.substring(0, index);
        String suffix      = fileName.substring(index);
        return preFileName + endSuffix + suffix;
    }
188600
public static Predicate<File> endsWithPredicate(final String suffix) {
    checkArgument(!suffix.isEmpty());

    return new EndsWithPredicate(suffix);
  }
645389
private static final String getExtension(String fileName) {
		return fileName.indexOf('.') == -1 ? null : fileName.substring(fileName.lastIndexOf('.') + 1);
	}
837900
public static Props loadPropsInDirs(final List<File> dirs, final String... suffixes) {
    final Props props = new Props();
    for (final File dir : dirs) {
      props.putLocal(loadPropsInDir(dir, suffixes));
    }
    return props;
  }
1159485
public static String getExtension(String fileName){
        int dot = fileName.lastIndexOf('.');
        return dot==-1 ? null : fileName.substring(dot+1);
    }
134072
def add_suffix(path, suffix=""):
    """"""
    return join(dirname(path), basename(path, ext=False) + suffix + extname(path))
779902
def files_in_dir(path, extension):
    """"""
    ends = '.{0}'.format(extension)
    return (f for f in os.listdir(path) if f.endswith(ends))
1179492
public boolean endsWith(final BinaryString suffix) {
		ensureMaterialized();
		suffix.ensureMaterialized();
		return matchAt(suffix, sizeInBytes - suffix.sizeInBytes);
	}
605764
@Deprecated
    private BufferedImage getImage(String suffix) throws IOException {
        StringBuffer buffer = getBaseImageUrl();
        buffer.append(suffix);
        return _getImage(buffer.toString());
    }