Returns the file name without its file extension or path. This is similar to the basename unix command. The result does not include the '.'. @param file The name of the file to trim the extension from. This can be either
(String file)
| 809 | |
| 810 | |
| 811 | public static String getNameWithoutExtension(String file) { |
| 812 | checkNotNull(file); |
| 813 | String fileName = new File(file).getName(); |
| 814 | int dotIndex = fileName.lastIndexOf('.'); |
| 815 | return (dotIndex == -1) ? fileName : fileName.substring(0, dotIndex); |
| 816 | } |
| 817 | |
| 818 | /** |
| 819 | * Returns a {@link TreeTraverser} instance for {@link File} trees. |
nothing calls this directly
no test coverage detected