Java tutorial
//package com.java2s; public class Main { /** * Get the file extension of the file so data type can be identified * @param url the url of the file address * @return the file extension */ public static String getFileExtension(String url) { String extension = url.substring(url.lastIndexOf(".") + 1); extension = extension.toLowerCase(); return extension; } }