code: private static String getExtension(String filename) {
  		if (filename == null) {
  			return null;
  		}
  		// The extension separator character.
  		final char extensionSeparator = '.';
  		// The Unix separator character.
  		final char unixSeparator = '/';
  		// The Windows separator character.
  		final char windowsSeparator = '\\';
  		final int extensionPos = filename.lastIndexOf(extensionSeparator);
  		final int lastUnixPos = filename.lastIndexOf(unixSeparator);
  		final int lastWindowsPos = filename.lastIndexOf(windowsSeparator);
  		final int lastSeparator = Math.max(lastUnixPos, lastWindowsPos);
  		final int index = lastSeparator > extensionPos ? -1 : extensionPos;
  		if (index == -1) {
  			return "";
  		}
  		return filename.substring(index + 1);
  	}
docs: Gets the extension of a filename.
  <p>
  This method returns the textual part of the filename after the last dot.
  There must be no directory separator after the dot.
  <pre>
  foo.txt      --> "txt"
  a/b/c.jpg    --> "jpg"
  a/b.txt/c    --> ""
  a/b/c        --> ""
  </pre>
  <p>
  The output will be the same irrespective of the machine that the code is running on.
  (Author Apache Commons IO 1.1)
  
  @param filename the filename to retrieve the extension of.
  @return the extension of the file or an empty string if none exists.