code: public static String getFormat(String fileName) {
          int lastDot = fileName.lastIndexOf('.');
          if (lastDot == -1)
              return null;
          return getLanguage(fileName.substring(lastDot));
      }
docs: Takes into account special rules due to multiple languages per extension.