@Test public void testGetExtensionNoExtension() { assertEquals(null, FileUtil.getExtension("some/file/without/an/extension")); }
public static String getExtension(String filename) { if (Util.isBlank(filename)) { return null; } if (filename.lastIndexOf('.') == -1) { return null; } return filename.substring(filename.lastIndexOf('.')+1); }
FileUtil { public static String getExtension(String filename) { if (Util.isBlank(filename)) { return null; } if (filename.lastIndexOf('.') == -1) { return null; } return filename.substring(filename.lastIndexOf('.')+1); } }
FileUtil { public static String getExtension(String filename) { if (Util.isBlank(filename)) { return null; } if (filename.lastIndexOf('.') == -1) { return null; } return filename.substring(filename.lastIndexOf('.')+1); }  }
FileUtil { public static String getExtension(String filename) { if (Util.isBlank(filename)) { return null; } if (filename.lastIndexOf('.') == -1) { return null; } return filename.substring(filename.lastIndexOf('.')+1); }  static String stripExtension(String filename); static String getExtension(String filename); static boolean hasExtension(String filename, String extension); }
FileUtil { public static String getExtension(String filename) { if (Util.isBlank(filename)) { return null; } if (filename.lastIndexOf('.') == -1) { return null; } return filename.substring(filename.lastIndexOf('.')+1); }  static String stripExtension(String filename); static String getExtension(String filename); static boolean hasExtension(String filename, String extension);  }