private String getExtension(File f) {
		String fileName = f.getName();
		String extension = "";
		
		int i = fileName.lastIndexOf('.'); //Get index of the last "." in the file name
		if (i > 0 && i < fileName.length() - 1) {
			extension = fileName.substring(i+1).toLowerCase(); //Extension formed from all characters following "."
		}
		
		return extension;
	}