public class FileNameUtils
extends java.lang.Object
Constructor and Description |
---|
FileNameUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getBaseName(java.lang.String filename)
Returns the basename (i.e.
|
static java.lang.String |
getExtension(java.lang.String filename)
Returns the extension (i.e.
|
public static java.lang.String getExtension(java.lang.String filename)
Will return an empty string if the file name doesn't contain
any dots. Only the last segment of a the file name is consulted
- i.e. all leading directories of the filename
parameter are skipped.
filename
- the name of the file to obtain the extension of.public static java.lang.String getBaseName(java.lang.String filename)
Will return the file name itself if it doesn't contain any
dots. All leading directories of the filename
parameter
are skipped.
filename
- the name of the file to obtain the basename of.