-
public class FileNameUtilsGeneric file name utilities.
-
-
Method Summary
Modifier and Type Method Description static StringgetExtension(String filename)Returns the extension (i.e. static StringgetBaseName(String filename)Returns the basename (i.e. -
-
Method Detail
-
getExtension
static String getExtension(String filename)
Returns the extension (i.e. the part after the last ".") of a file.
Will return an empty string if the file name doesn't containany dots. Only the last segment of a the file name is consulted- i.e. all leading directories of the
{@code filename}parameter are skipped.- Parameters:
filename- the name of the file to obtain the extension of.
-
getBaseName
static String getBaseName(String filename)
Returns the basename (i.e. the part up to and not including thelast ".") of the last path segment of a filename.
Will return the file name itself if it doesn't contain anydots. All leading directories of the
{@code filename}parameterare skipped.- Parameters:
filename- the name of the file to obtain the basename of.
-
-
-
-