MCPcopy Create free account
hub / github.com/antlr/codebuff / getFileExtension

Method getFileExtension

corpus/java/training/guava/io/Files.java:754–759  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

752 * @since 11.0
753 */
754 public static String getFileExtension(String fullName) {
755 checkNotNull(fullName);
756 String fileName = new File(fullName).getName();
757 int dotIndex = fileName.lastIndexOf('.');
758 return (dotIndex == -1) ? "" : fileName.substring(dotIndex + 1);
759 }
760
761 /**
762 * Returns the file name without its

Callers

nothing calls this directly

Calls 3

checkNotNullMethod · 0.45
getNameMethod · 0.45
lastIndexOfMethod · 0.45

Tested by

no test coverage detected