returns lower cased extension

TODO: if we support the path being a folder (to be zipped), then
this method will need to be smarter in terms of searching for an "extension"
511348
private static String getFileExtension(String path) {
        int index = path.lastIndexOf('.');
        if (index == -1) {
            return null;
        }

        return path.substring(index + 1).toLowerCase(Locale.ENGLISH);
    }
398199
def get_expanded_path(self, path):
        
        if path.startswith('~'):
            return os.path.expanduser('~') + path[1:]
        else:
            return path
816611
def GetRootFileEntry(self):
    
    path_spec = zip_path_spec.ZipPathSpec(
        location=self.LOCATION_ROOT, parent=self._path_spec.parent)
    return self.GetFileEntryByPathSpec(path_spec)
1209566
public static String getExtension(String strFile, String defaultValue) {
	int pos = strFile.lastIndexOf('.');
	if (pos == -1) return defaultValue;
	return strFile.substring(pos + 1);
    }
197270
public static String removeExtension(String path) throws IllegalArgumentException
  {
    Params.notNull(path, "Path");
    int extensionIndex = path.lastIndexOf('.');
    return extensionIndex != -1 ? path.substring(0, extensionIndex) : path;
  }
407983
def extension(filename):
    ''''''
    filename = os.path.basename(filename)
    extension = None

    while '.' in filename:
        filename, ext = os.path.splitext(filename)
        if ext.startswith('.'):
            ext = ext[1:]
        extension = ext if not extension else ext + '.' + extension

    return extension
1210153
private String getSiteRoot() {

        String res;

        if (m_simpleFieldSiteRoot.isVisible()) {
            res = m_simpleFieldSiteRoot.getValue();
        } else {
            res = "/" + ensureFoldername(getParentFolder()) + ensureFoldername(getFieldFolder());
            res = res.endsWith("/") ? res.substring(0, res.length() - 1) : res;
        }
        return res;
    }
1253946
def get_expanded_path(path):
    """"""
    if path:
        result = path
        result = os.path.expanduser(result)
        result = os.path.expandvars(result)
        return result
    else:
        return None
1257067
function getExtensionlessFilename( filename ) {
	return filename.substr( 0, filename.length - path.extname( filename ).length);
}
713767
def split_extension(pathname):
        
        filepart = win32.PathRemoveExtension(pathname)
        extpart  = win32.PathFindExtension(pathname)
        return (filepart, extpart)
79373
def match(self, string):
        """"""
        if self.casesensitive:
            return self.pattern == os.path.normcase(string)
        else:
            return self.pattern.lower() == os.path.normcase(string).lower()
871452
public static String getExtension(String path) {
        int dot = path.lastIndexOf(".");
        if (dot == -1) {
            return "";
        } else {
            return path.substring(dot + 1, path.length());
        }
    }
169517
def extensions_in_same_folder(file_name):
    """"""

    directory = os.path.dirname(file_name)
    files = os.listdir(directory)
    extensions = list(zip(*map(os.path.splitext, files)))[1]
    extensions = set([ext.lower() for ext in extensions])
    return extensions
664869
public static final char getFileTypeLetter(Path path)
    {
        if (Files.isRegularFile(path))
        {
            return '-';
        }
        if (Files.isDirectory(path))
        {
            return 'd';
        }
        if (Files.isSymbolicLink(path))
        {
            return 'l';
        }
        throw new IllegalArgumentException(path+" is either regular file, directory or symbolic link");
    }
1337104
def allowed_extension(*allowed):
    '''
    
    '''
    def predicate(info, request):
        log.debug(request.path)
        ext = os.path.splitext(request.path)[1]
        request.environ['path_extenstion'] = ext
        log.debug(ext)
        return ext in allowed

    return predicate
23088
def find_extensions_in(path: typing.Union[str, pathlib.Path]) -> list:
    

    if not isinstance(path, pathlib.Path):
        path = pathlib.Path(path)

    if not path.is_dir():
        return []

    extension_names = []

    # Find extensions directly in this folder
    for subpath in path.glob('*.py'):
        parts = subpath.with_suffix('').parts
        if parts[0] == '.':
            parts = parts[1:]

        extension_names.append('.'.join(parts))

    # Find extensions as subfolder modules
    for subpath in path.glob('*/__init__.py'):
        parts = subpath.parent.parts
        if parts[0] == '.':
            parts = parts[1:]

        extension_names.append('.'.join(parts))

    return extension_names
1112191
def extract_path_ext(path, default_ext=None):
    
    ext = None
    _, dotext = os.path.splitext(path)
    if dotext:
        ext = dotext[1:]
    if not ext and default_ext:
        ext = default_ext
    if not ext:
        raise ValueError('No extension in path {} and default_ext is None'.format(path))
    return ext