public class FileNameUtils extends Object
Constructor and Description |
---|
FileNameUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
getBaseName(String filename)
Returns the basename (i.e.
|
static String |
getExtension(String filename)
Returns the extension (i.e.
|
public FileNameUtils()
public static String getExtension(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 String getBaseName(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.Copyright © 2020 The Apache Software Foundation. All rights reserved.