Returns the file extension for the given file name, or the empty string if the file has no extension. The result does not include the '.'. @since 11.0
(String fullName)
| 791 | |
| 792 | |
| 793 | public static String getFileExtension(String fullName) { |
| 794 | checkNotNull(fullName); |
| 795 | String fileName = new File(fullName).getName(); |
| 796 | int dotIndex = fileName.lastIndexOf('.'); |
| 797 | return (dotIndex == -1) ? "" : fileName.substring(dotIndex + 1); |
| 798 | } |
| 799 | |
| 800 | /** |
| 801 | * Returns the file name without its |
nothing calls this directly
no test coverage detected