public static String getExt(String path) { String result = null; try { result = path.substring(path.lastIndexOf(".") + 1); } catch (Exception e) { result = ""; } return result; }