Package org.apache.sshd.common.util.io
Class PathUtils
java.lang.Object
org.apache.sshd.common.util.io.PathUtils
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Comparator
<Path> static final Comparator
<Path> static final UnaryEquator
<Path> static final UnaryEquator
<Path> static final char
private static final AtomicReference
<Supplier<? extends Path>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringBuilder
static StringBuilder
appendUserHome
(StringBuilder sb, String userHome) static StringBuilder
appendUserHome
(StringBuilder sb, Path userHome) static Path
static String
normalizePath
(String path) Replaces leading '~' with user's HOME directory Replaces any forward slashes with the O/S directory separatorstatic int
safeCompareFilename
(Path p1, Path p2, boolean caseSensitive) static void
setUserHomeFolderResolver
(Supplier<? extends Path> resolver) Set the reported value fromgetUserHomeFolder()
-
Field Details
-
BY_CASE_INSENSITIVE_FILENAME
-
EQ_CASE_INSENSITIVE_FILENAME
-
BY_CASE_SENSITIVE_FILENAME
-
EQ_CASE_SENSITIVE_FILENAME
-
HOME_TILDE_CHAR
public static final char HOME_TILDE_CHAR- See Also:
-
USER_HOME_RESOLVER_HOLDER
-
-
Constructor Details
-
PathUtils
private PathUtils()Private Constructor
-
-
Method Details
-
safeCompareFilename
-
normalizePath
- Replaces leading '~' with user's HOME directory
- Replaces any forward slashes with the O/S directory separator
- Parameters:
path
- Input path - ignored ifnull
/empty/blank- Returns:
- Adjusted path
-
getUserHomeFolder
- Returns:
- The
Path
to the currently running user home - See Also:
-
setUserHomeFolderResolver
Set the reported value fromgetUserHomeFolder()
- Parameters:
resolver
- ThePath
provider to report - ifnull
then "user.home" system property will be used
-
appendUserHome
-
appendUserHome
-
appendUserHome
-