public class NamingUtil
Modifiers | Name | Description |
---|---|---|
static int |
DEFAULT_MAX_FILE_NAME_LENGTH |
|
static String |
ELLIPSIS |
|
static int |
MAX_FILE_PATH_LENGTH |
Type Params | Return Type | Name and description |
---|---|---|
|
public static String |
getUniqueFileName(String preferredName, String location) |
|
public static String |
getUniqueFileName(String preferredName, String location, Integer sequenceNumber) |
|
public static String |
makeEllipsisFileName(String fileName) |
|
public static String |
makeEllipsisFileName(String fileName, int maxLength) |
|
public static String |
makeEllipsisName(String name) |
|
public static String |
makeEllipsisName(String name, int maxLength)
|
|
public static String |
makeEllipsisPath(String path) |
|
public static String |
makeEllipsisPath(String path, int maxNameLength) |
|
public static File |
makeEllipsisPath(File file) |
|
public static File |
makeEllipsisPath(File file, int maxNameLength) |
|
public static Path |
makeEllipsisPath(Path path) |
|
public static Path |
makeEllipsisPath(Path path, int maxNameLength) |
|
public static File |
sanitizeFileName(File file) |
|
public static Path |
sanitizeFileName(Path path) |
|
public static String |
sanitizeFileName(String name) |
|
public static File |
truncateAndSanitizePath(File file) |
|
public static File |
truncateAndSanitizePath(File file, int maxNameLength) |
|
public static Path |
truncateAndSanitizePath(Path path) |
|
public static Path |
truncateAndSanitizePath(Path path, int maxNameLength) |
name
- a non-extension name (e.g. "abc" - and not "abc.txt").
If the name includes the extension, then use "NamingUtil.makeEllipsisFileName(...)" instead.
This way, we can reuse this method for other kind of names.