Share via


Overview | Methods | This Package | All Packages

OverviewMethodsThis PackageAll Packages

File.getExtension

Retrieves the extension of the specified path.

Syntax

public static String getExtension( String path )

Parameters

path

The path of a file or directory.

Return Value

Returns the extension of the specified path, or returns null if the specified path is null or does not include an extension.

Remarks

The return value includes the period (.) in the extension, such as .exe or .java.

See Also   changeExtension, getDirectory, getName, getRoot, hasExtension