Returns the filename from the given file with the systemtime.

@param fileToRename
The file.
@param add2Name
Adds the Date to the Filename.

@return Returns the filename from the given file with the systemtime.
544986
public static String appendSystemtimeToFilename(final File fileToRename, final Date add2Name)
	{
		final String format = "HHmmssSSS";
		String sysTime = null;
		if (null != add2Name)
		{
			final DateFormat df = new SimpleDateFormat(format);
			sysTime = df.format(add2Name);
		}
		else
		{
			final DateFormat df = new SimpleDateFormat(format);
			sysTime = df.format(new Date());
		}

		final String fileName = fileToRename.getName();
		final int ext_index = fileName.lastIndexOf(".");
		final String ext = fileName.substring(ext_index, fileName.length());
		String newName = fileName.substring(0, ext_index);
		newName += "_" + sysTime + ext;
		return newName;
	}
512385
public String getBackupFilename(String strFilenameTemplate)
    {
        Date now = new Date();
        String strDate = this.dateToString(now);
        for (int i = 0; i < strDate.length(); i++)
        {
            char ch = strDate.charAt(i);
            if (!Character.isLetterOrDigit(ch))
                strDate = strDate.substring(0, i) + '_' + strDate.substring(i + 1, strDate.length());
        }
        return MessageFormat.format(strFilenameTemplate, strDate);
    }
84955
public static String getSubFileName(String fileName, String parentFileName) {
		if (parentFileName == null) {
			return fileName;
		}
		if (fileName.startsWith("/")) {
			return fileName;
		}
		int index = parentFileName.lastIndexOf('/');
		if (index == -1) {
			return fileName;
		}
		return parentFileName.substring(0, index + 1) + fileName;
	}
930197
private String fileName(String fieldName, Object documentId) {
		return fieldName + "_" + String.valueOf( documentId );
	}
290432
public static String getSafeFilename(String filename)
   {
      String result = filename;
      if (result != null)
      {
         result = result.replaceAll("[^a-zA-Z0-9]+", "-").replaceAll("^-+", "");
      }
      return result;
   }
531398
@Pure
	@Inline("((($1) == null) ? null : ($1).getName())")
	public static String largeBasename(File filename) {
		if (filename == null) {
			return null;
		}
		return filename.getName();
	}
174233
public Date getLastModified(String filename)
        throws IOException, ServerException {
        if (filename == null) {
            throw new IllegalArgumentException("Required argument missing");
        }
        Command cmd = new Command("MDTM", filename);
        Reply reply = null;
        try {
            reply = controlChannel.execute(cmd);
        } catch (FTPReplyParseException rpe) {
            throw ServerException.embedFTPReplyParseException(rpe);
        } catch (UnexpectedReplyCodeException urce) {
            throw ServerException.embedUnexpectedReplyCodeException(
                                urce,
                                "Server refused changing transfer mode");
        }

        if (dateFormat == null) {
            dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
            dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
        }

        try {
            return dateFormat.parse(reply.getMessage());
        } catch (ParseException e) {
            throw ServerException.embedFTPReplyParseException(
                     new FTPReplyParseException(
                            0,
                            "Invalid file modification time reply: " + reply));
        }
    }
45310
function getFileByName(filename){
    if(!isLoaded[filename]){
        isLoaded[filename] = true;
        let CIniUserMgr	= CreateFile(filename);
        if (CIniUserMgr.IsHave()) {
            iniList[filename] = CIniUserMgr;
        }
    }
    return iniList[filename];
}
824046
public static String getByFilename(String fileName, String defaultType) {
        String extn = getExtension(fileName);
        if (extn != null) {
            return get(extn, defaultType);
        } else {
            // no extension, no content type
            return null;
        }
    }
643653
public static String getExtension(String fileName) {
        if (fileName.contains(".")) {
            return fileName.substring(fileName.lastIndexOf(".") + 1);
        }
        return "png";
    }
763701
public static String createTimestampedFilename(String filenamePrefix,
                                                   Date date) {
        SimpleDateFormat formatter =
                new SimpleDateFormat(FORMAT_JOURNAL_FILENAME_TIMESTAMP);
        formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
        return filenamePrefix + formatter.format(date) + "Z";
    }
541495
private static String nameOnly(final String filename) {
        final int p = filename.lastIndexOf('.');
        if (p == -1) {
            return filename;
        }
        return filename.substring(0, p);
    }
1080260
private static int getIndexFromFilename(String fileName) {
        // remove the beginning of the file name
        String resStr = fileName.replace(
                latestMOTDSerializedFileName.substring(0, latestMOTDSerializedFileName.indexOf("{index}")), "");

        // remove the end of the file name
        resStr = resStr.replace(
                latestMOTDSerializedFileName.substring(latestMOTDSerializedFileName.indexOf("{index}") + 7), "");

        return Integer.parseInt(resStr);
    }
291922
private String extractExtension(String filename) {
    int startExtension = filename.indexOf('.');
    if (startExtension > 0) {
      return filename.substring(startExtension + 1);
    }
    return "";
  }
1024632
function getFullFilename(filename) {
  if (p.isAbsolute(filename)) {
    return filename
  }
  return p.join(process.cwd(), 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;
    }