public class FilenameUtil extends Object
Constructor and Description |
---|
FilenameUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
concat(String basePath,
String fullFilenameToAdd)
Concatenates a filename to a base path using normal command line style rules.
|
static String |
getDirectory(String filename)
If the path is a file, return everything up to the file.
|
static String |
normalize(String filename)
Normalizes a path, removing double and single dot path steps as well as standardizing on "/" for a slash.
|
static String |
sanitizeFileName(String fileName)
Remove problematic characters from filename and replace them with '_'
https://stackoverflow.com/questions/1976007/what-characters-are-forbidden-in-windows-and-linux-directory-names
|
public static String normalize(String filename)
public static String concat(String basePath, String fullFilenameToAdd)
The returned path will be normalize(String)
'ed
public static String getDirectory(String filename)
The returned path will be normalize(String)
'ed
public static String sanitizeFileName(String fileName)
' ' '/' ':' '"' '\' '|' '*' '?' '<' '>'
fileName
- Filename to remove characters fromCopyright © 2023 Liquibase.org. All rights reserved.