public static String getExtension(String path, int extLevel) {

		Objects.requireNonNull(path);
		if (extLevel < 1) {
			throw new IllegalArgumentException("Bad extention level: " + extLevel);
		}

		for (int i = path.length() - 1; i >= 0; i--) {
			char c = path.charAt(i);
			if (SEPARATOR_CHARS.indexOf(c) != -1) { // moved past the filename				
				return null;
			}
			if (c == DOT) {
				if (--extLevel == 0) {
					return path.substring(i);
				}
			}
		}
		return null;
	}
Returns the "extension" of the filename part of the path string.
<p>
Ie. everything after the nth last '.' char in the filename, including that '.' character.
<p>
Using: "path/filename.ext1.ext2"
<P>
Gives:
<UL>
	<LI>extLevel 1: ".ext2"</LI>
 <LI>extLevel 2: ".ext1.ext2"</LI>
 <LI>extLevel 3: <code>null</code></LI>
</UL>

@param path path/filename.ext string
@param extLevel number of ext levels; must be greater than 0
@return ".ext1" for "path/filename.notext.ext1" level 1, ".ext1.ext2" for
        "path/filename.ext1.ext2" level 2, etc. or null if there was no dot character
@throws IllegalArgumentException if the given level is less than 1
Ghidra/Features/Base/src/main/java/ghidra/formats/gfilesystem/FSUtilities.java