Returns the file name defined by applying the given pattern to the project name.
Returns null if the file pattern is invalid.
978624
private String getProjectFile( String projectName, String filePattern)
    {
    String projectFile = null;
    if( !StringUtils.isBlank( filePattern))
      {
      Matcher matcher = projectFilePattern_.matcher( filePattern);
      if( matcher.matches())
        {
        projectFile =
          StringUtils.isBlank( matcher.group(2))
          ? filePattern
          : matcher.group(1) + projectName + matcher.group(3);
        }
      }
    
    return projectFile;
    }
52912
protected final void parseFileNamePattern() {
    List converters = new ArrayList();
    List fields = new ArrayList();

    ExtrasPatternParser.parse(
            fileNamePatternStr, converters, fields, null,
            ExtrasPatternParser.getFileNamePatternRules());
    patternConverters = new PatternConverter[converters.size()];
    patternConverters =
      (PatternConverter[]) converters.toArray(patternConverters);
    patternFields = new ExtrasFormattingInfo[converters.size()];
    patternFields = (ExtrasFormattingInfo[]) fields.toArray(patternFields);
  }
628764
public static String getFileExt(String fileName) {
        int dotPos = fileName.lastIndexOf('.');
        if (dotPos != -1 && dotPos != fileName.length() - 1) {
            return fileName.substring(dotPos);
        } else {
            return null;
        }
    }
1114197
def project_path(*names):
    """"""
    return os.path.join(os.path.dirname(__file__), *names)
565876
@Nullable
  public String getSourceFileName() {
    StaticSourceFile file = getStaticSourceFile();
    return file == null ? null : file.getName();
  }
382449
private String getFilename(String filename, File file) {
        if (!file.exists()) {
            file.mkdirs();
        }
        String ext = ".jpg";
        //get extension
        /*if (Pattern.matches("^[.][p][n][g]", filename)){
            ext = ".png";
        }*/

        return (file.getAbsolutePath() + "/IMG_" + new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()) + ext);

    }
301410
private File findFile(String fileName, List path)
    {
        final String methodName = "findFile(): ";
        String fileSeparator = System.getProperty("file.separator");
        for (Iterator i = path.iterator(); i.hasNext();)
        {
            String directory = (String) i.next();
            if (!directory.endsWith(fileSeparator) && !fileName.startsWith(fileSeparator))
            {
                directory = directory + fileSeparator;
            }
            File file = new File(directory + fileName);
            if (log.isDebugEnabled())
            {
                log.debug(methodName + " checking '" + file.getAbsolutePath() + "'");
            }
            if (file.exists() && file.canRead())
            {
                log.debug(methodName + " found it - file is '" + file.getAbsolutePath() + "'");
                cache.put(fileName, new CacheEntry(file));
                return file;
            }
        }
        return null;
    }
676821
protected String processFileName(String name) {

        int pos = name.lastIndexOf("/");
        if (pos >= 0) {
            name = name.substring(pos + 1);
        }
        pos = name.lastIndexOf("\\");
        if (pos >= 0) {
            name = name.substring(pos + 1);
        }
        return name;
    }
76219
private File searchFile(File directory, String pattern) {
        if (!directory.isDirectory()) {
            throw new IllegalArgumentException("Not a directly: "+directory);
        }
        File[] files = directory.listFiles();
        assert files != null; //checked for directly above.
        for (File file : files) {
            if (file.getName().matches(pattern)) return file;
        }
        return null;
    }
992018
function getNameFromFileName(filename) {
  var file = basename(filename).replace(/\.(?:pug|jade)$/, '');
  return file.toLowerCase().replace(/[^a-z0-9]+([a-z])/g, function (_, character) {
    return character.toUpperCase();
  }) + 'Template';
}
1234237
public String getFilename(String name)
    {
        List part = (List)_partMap.getValues(name);
        if (part==null)
            return null;
        return ((Part)part.get(0))._filename;
    }
753651
protected String getFilename(Object result, String filenamepre) {
    if(filenamepre == null || filenamepre.length() == 0) {
      filenamepre = "result";
    }
    for(int i = 0;; i++) {
      String filename = i > 0 ? filenamepre + "-" + i : filenamepre;
      Object existing = filenames.get(filename);
      if(existing == null || existing == result) {
        filenames.put(filename, result);
        return filename;
      }
    }
  }
1162888
private String getFileFromCache(String filename) {
        LRUCache.CacheEntry<String, T> cachedTemplate = cache.get(filename);

        if (cachedTemplate == null) {
            return null;
        }

        return cache.get(filename).raw;
    }
1226023
protected boolean name_matches(String pattern) {
	pattern = pattern.toLowerCase().replaceAll("[*]{1}", ".*?");
	return name.toLowerCase().matches(pattern) || get_fully_qualified_name().toLowerCase().matches(pattern);
    }
635202
@Nullable
    public static String getFileExtension(@NotNull String fileName) {
        @Nullable
        final String fileExt = FilenameUtils.getExtension(fileName);
        return StringUtils.isNoneEmpty(fileExt) ? StringUtils.lowerCase(fileExt) : null;
    }
233622
@Nullable
  private static String _getFilename (@Nullable final String sContentDisposition)
  {
    String sFilename = null;
    if (sContentDisposition != null)
    {
      final String sContentDispositionLC = sContentDisposition.toLowerCase (Locale.US);
      if (sContentDispositionLC.startsWith (RequestHelper.FORM_DATA) ||
          sContentDispositionLC.startsWith (RequestHelper.ATTACHMENT))
      {
        // Parameter parser can handle null input
        final ICommonsMap <String, String> aParams = new ParameterParser ().setLowerCaseNames (true)
                                                                           .parse (sContentDisposition, ';');
        if (aParams.containsKey ("filename"))
        {
          sFilename = aParams.get ("filename");
          if (sFilename != null)
          {
            sFilename = sFilename.trim ();
          }
          else
          {
            // Even if there is no value, the parameter is present,
            // so we return an empty file name rather than no file
            // name.
            sFilename = "";
          }
        }
      }
    }
    return sFilename;
  }
209719
public String getMatchingBundle(Pattern symbolicNamePattern) {
    for (String bundleSymbolicName : bundleSymbolicNames) {
      if (symbolicNamePattern.matcher(bundleSymbolicName).matches()) {
        return bundleSymbolicName;
      }
    }
    return null;
  }