public class FileNameUtils
extends java.lang.Object
Constructor and Description |
---|
FileNameUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getBaseName(java.nio.file.Path path)
Gets the basename (i.e.
|
static java.lang.String |
getBaseName(java.lang.String filename)
Gets the basename (i.e.
|
static java.lang.String |
getExtension(java.nio.file.Path path)
Gets the extension (i.e.
|
static java.lang.String |
getExtension(java.lang.String filename)
Gets the extension (i.e.
|
public static java.lang.String getBaseName(java.nio.file.Path path)
Will return the file name itself if it doesn't contain any
dots. All leading directories of the filename
parameter
are skipped.
path
- the path of the file to obtain the basename 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.public static java.lang.String getExtension(java.nio.file.Path path)
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.
path
- the path of the file to obtain the extension of.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.Copyright © 2010 - 2023 Adobe. All Rights Reserved