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

Method getFileExtension

output/java_guava/1.4.18/Files.java:792–797  ·  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

790
791
792 public static String getFileExtension(String fullName) {
793 checkNotNull(fullName);
794 String fileName = new File(fullName).getName();
795 int dotIndex = fileName.lastIndexOf('.');
796 return (dotIndex == -1) ? "" : fileName.substring(dotIndex + 1);
797 }
798
799 /**
800 * 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