public class PathUtils extends Object
| Constructor and Description |
|---|
PathUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
extensionSeparatorIndex(String filename)
Locate the index of the file's extension.
|
static int |
filenameSeparatorIndex(String filename)
Locate where the path ends
So to say: c:\path.name\filename: index of \ before filename /path.name/filename: index of / before filename c:\path/filename: -index of / before filename c:/path\filename.ext: index of \ before filename |
static String |
getFileExtension(String filePath)
Get only the file extension given a path
|
static String |
getFileName(String filePath)
Get the filename (with extension of a file path).
|
static String |
getFileNameNoExtension(String filePath)
Get the filename, and then strip the extension
|
static String |
getFilePath(String filePath)
Get the path of the filename, minus filename and extension
|
static String |
getFilePathWithSeparator(String filePath)
Get the path of the filename, minus filename and extension
|
public static int filenameSeparatorIndex(String filename)
filename - is the filename to examinepublic static int extensionSeparatorIndex(String filename)
filename - is the filename to examinepublic static String getFileName(String filePath)
filePath - is the complete or partial filenamepublic static String getFileNameNoExtension(String filePath)
filePath - is the filename to examinepublic static String getFileExtension(String filePath)
filePath - is the path to examinepublic static String getFilePath(String filePath)
filePath - is the path to examineCopyright © 2017. All rights reserved.