Returns the name of the file without path an extension.

@param filename
Filename to extract the name from.

@return Simple name.
541495
private static String nameOnly(final String filename) {
        final int p = filename.lastIndexOf('.');
        if (p == -1) {
            return filename;
        }
        return filename.substring(0, p);
    }
123407
public function getNameWithoutExtension($fileName)
    {
        $lastDot = strrpos($fileName, '.');

        if (!$lastDot) {
            return $fileName;
        }

        return substr($fileName, 0, $lastDot);
    }
1257067
function getExtensionlessFilename( filename ) {
	return filename.substr( 0, filename.length - path.extname( filename ).length);
}
597255
public String getFileName(String originalFileName) {

        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_targetFileName)) {
            return m_targetFileName;
        } else if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_targetFileNamePrefix)) {
            return m_targetFileNamePrefix + originalFileName;
        } else {
            return originalFileName;
        }
    }
394532
public static String getExtension(String fileName) {
    int pos = fileName.lastIndexOf('.');
    if (pos < 0) {
      return "";
    }
    return fileName.substring(pos + 1);
  }
1272670
private static String getExtension(String fileName) {
        // play it safe and get rid of any fragment id
        // that might be there
        int length = fileName.length();

        int newEnd = fileName.lastIndexOf('#');
        if (newEnd == -1) {
            newEnd = length;
        }
        int i = fileName.lastIndexOf('.', newEnd);
        if (i != -1) {
            return fileName.substring(i + 1, newEnd);
        } else {
            // no extension, no content type
            return null;
        }
    }
966281
public static String getScriptEngineName(String filename) {
        String extension = FilenameUtils.getExtension(filename);
        if (StringUtils.isBlank(extension)) {
            logger.warn("Can't determine engine name based on filename without extension {}",filename);
            return null;
        }
        ScriptEngineManager manager = new ScriptEngineManager();
        List<ScriptEngineFactory> engines = manager.getEngineFactories();
        for (ScriptEngineFactory engineFactory : engines) {
            List<String> extensions = engineFactory.getExtensions();
            for (String supportedExt : extensions) {
                if (extension.equals(supportedExt)) {
                    // return first short name
                    return engineFactory.getNames().get(0);
                }
            }
        }
        logger.warn("Can't determine engine name based on filename and available script engines {}",filename);
        return null;
    }
648218
public function getFilenameWithExtension() {
		if ($this->extension === null) {
			return $this->filename;
		}
		else {
			return $this->filename . '.' . $this->extension;
		}
	}
1234237
public String getFilename(String name)
    {
        List part = (List)_partMap.getValues(name);
        if (part==null)
            return null;
        return ((Part)part.get(0))._filename;
    }
1320585
public static String getExtension(String fileName) {
		if (fileName==null){
			return null;
		} else {
			int number=fileName.lastIndexOf('.');
			
			if (number>=0){
				return fileName.substring(number+1, fileName.length());
			} else {
				return null;
			}
		}		
	}
1350369
@Pure
	public static String shortBasename(File filename) {
		if (filename == null) {
			return null;
		}
		final String largeBasename = filename.getName();
		final int idx = largeBasename.indexOf(getFileExtensionCharacter());
		if (idx < 0) {
			return largeBasename;
		}
		return largeBasename.substring(0, idx);
	}
1320104
public static String getFilenameExtension(String path) {
        if (path == null) return null;

        int extIndex = path.lastIndexOf(EXTENSION_SEPARATOR);
        if (extIndex == -1) return null;

        int folderIndex = path.lastIndexOf(FOLDER_SEPARATOR);
        if (folderIndex > extIndex) return null;

        return path.substring(extIndex + 1);
    }
671110
public static @NotNull String validFilename(@NotNull String value) {
    String fileExtension = StringUtils.substringAfterLast(value, ".");
    String fileName = StringUtils.substringBeforeLast(value, ".");
    if (StringUtils.isEmpty(fileExtension)) {
      return validName(fileName);
    }
    return validName(fileName) + "." + validName(fileExtension);
  }
205773
public String toFilename() {
        if (m_filename == null) { // lazily convert, since not always needed
            m_filename = m_normalized.replaceAll(":", "_");
            if (m_filename.endsWith(".")) {
                m_filename =
                        m_filename.substring(0, m_filename.length() - 1) + "%";
            }
        }
        return m_filename;
    }
1022382
def get_filename(file):
    
    if not os.path.exists(file):
        return None
    return "%s%s" % os.path.splitext(file)
565986
public static boolean isArchiveFileName(String fileName) {
        String extension = getExtension(fileName);
        return ARCHIVE_EXTENSION_SET.contains(extension);
    }
35821
protected function getTitleFromFilename(string $filename)
    {
        $withoutExtension = pathinfo($filename, PATHINFO_FILENAME);
        return $withoutExtension !== '' ? $withoutExtension : $filename;
    }