Package drivers
Class ResolvePath
java.lang.Object
drivers.ResolvePath
This tries to resolve a filepath which may contain "./", "ยค/","~/" or (several of) "../", as well as "/" or "\" as separator.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate the object, with a path (as string) to the current base dir. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
resolvePath
(String pName, boolean addSep) Gets the canonical path of a file: First convert all "/" or "\" to the file separator used in this JVM, then get the canonical path of the file.Canonical path here means a path where all path abbreviations (such as "../") are resolved.static String[]
resolvePaths
(String[] pName, boolean addSep) Resolve all pathnames in the array passed as parameter.
-
Field Details
-
INIFILE_DIR
-
-
Constructor Details
-
ResolvePath
Create the object, with a path (as string) to the current base dir.- Parameters:
f
-
-
-
Method Details
-
resolvePath
Gets the canonical path of a file: First convert all "/" or "\" to the file separator used in this JVM, then get the canonical path of the file.Canonical path here means a path where all path abbreviations (such as "../") are resolved.- Parameters:
pName
- pathname of a fileaddSep
- flag whether a path separator should be added at end (if true: add, else remove it if it is there)- Returns:
- the canonicial path (where all path abbreviations are resolved) or "" if any problem (i.e. null, empty or invalid path name passed as parameter).
-
resolvePaths
Resolve all pathnames in the array passed as parameter.- Parameters:
pName
- array with pathnames to solveaddSep
- flag whether a path separator should be added (if true: add)- Returns:
-