public final class PathUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static Comparator<Path> |
BY_CASE_INSENSITIVE_FILENAME
|
static Comparator<Path> |
BY_CASE_SENSITIVE_FILENAME
|
static UnaryEquator<Path> |
EQ_CASE_INSENSITIVE_FILENAME |
static UnaryEquator<Path> |
EQ_CASE_SENSITIVE_FILENAME |
static char |
HOME_TILDE_CHAR |
| Modifier and Type | Method and Description |
|---|---|
static StringBuilder |
appendUserHome(StringBuilder sb) |
static StringBuilder |
appendUserHome(StringBuilder sb,
Path userHome) |
static StringBuilder |
appendUserHome(StringBuilder sb,
String userHome) |
static Path |
getUserHomeFolder() |
static String |
normalizePath(String path)
Replaces leading '~' with user's HOME directory
Replaces any forward slashes with the O/S directory separator
|
static int |
safeCompareFilename(Path p1,
Path p2,
boolean caseSensitive)
|
static void |
setUserHomeFolderResolver(Supplier<? extends Path> resolver)
Set the reported value from
getUserHomeFolder() |
public static final Comparator<Path> BY_CASE_INSENSITIVE_FILENAME
public static final UnaryEquator<Path> EQ_CASE_INSENSITIVE_FILENAME
public static final Comparator<Path> BY_CASE_SENSITIVE_FILENAME
public static final UnaryEquator<Path> EQ_CASE_SENSITIVE_FILENAME
public static final char HOME_TILDE_CHAR
public static String normalizePath(String path)
path - Input path - ignored if null/empty/blankpublic static Path getUserHomeFolder()
Path to the currently running user homesetUserHomeFolderResolver(Supplier)public static void setUserHomeFolderResolver(Supplier<? extends Path> resolver)
getUserHomeFolder()resolver - The Path provider to report - if null then "user.home" system property
will be usedpublic static StringBuilder appendUserHome(StringBuilder sb)
public static StringBuilder appendUserHome(StringBuilder sb, Path userHome)
public static StringBuilder appendUserHome(StringBuilder sb, String userHome)
Copyright © 2018–2024 The Apache Software Foundation. All rights reserved.