Package uk.blankaspect.common.filesystem
Class PathUtils
java.lang.Object
uk.blankaspect.common.filesystem.PathUtils
This class contains utility methods that relate to file-system locations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Path
Converts the specified file-system location to a normalised absolute location and returns the result.static Path
Converts the specified file-system location to a normalised absolute location and returns the parent of the resulting location.static String
Converts the specified file-system location to a normalised absolute location and returns a string representation of the resulting location.static String
absStringStd
(Path location) Converts the specified file-system location to a normalised absolute location and returns a string representation of the resulting location in which the system-dependent separators between adjacent components are replaced by Unix separators,'/'
.convertLocations
(Iterable<? extends File> files) static String
Concatenates the string representations of the specified locations, with adjacent locations separated by the system-dependent separator character, and returns the resulting string.static String
Concatenates the string representations of the specified locations, with adjacent locations separated by the system-dependent separator character, and returns the resulting string.
-
Method Details
-
abs
Converts the specified file-system location to a normalised absolute location and returns the result. The following methods are called sequentially on the input location:- Parameters:
location
- the location of interest.- Returns:
location
converted to an absolute location and normalised.
-
absParent
Converts the specified file-system location to a normalised absolute location and returns the parent of the resulting location. The following methods are called sequentially on the input location:- Parameters:
location
- the location of interest.- Returns:
- the parent of
location
after it is converted to an absolute location and normalised.
-
absString
Converts the specified file-system location to a normalised absolute location and returns a string representation of the resulting location. The following methods are called sequentially on the input location:- Parameters:
location
- the location of interest.- Returns:
- a string representation of
location
after it is converted to an absolute location and normalised.
-
absStringStd
Converts the specified file-system location to a normalised absolute location and returns a string representation of the resulting location in which the system-dependent separators between adjacent components are replaced by Unix separators,'/'
. The following methods are called sequentially on the input location:- Parameters:
location
- the location of interest.- Returns:
- a string representation of
location
after it is converted to an absolute location and normalised. In the string representation, the system-dependent separators between adjacent components are replaced by Unix separators,'/'
.
-
join
Concatenates the string representations of the specified locations, with adjacent locations separated by the system-dependent separator character, and returns the resulting string.- Parameters:
locations
- the locations that will be concatenated.- Returns:
- a concatenation of the string representations of
locations
, with adjacent locations separated by the system-dependent separator character.
-
join
Concatenates the string representations of the specified locations, with adjacent locations separated by the system-dependent separator character, and returns the resulting string.- Parameters:
locations
- the locations that will be concatenated.- Returns:
- a concatenation of the string representations of
locations
, with adjacent locations separated by the system-dependent separator character.
-
convertLocations
Returns a list ofPath
s in which each element corresponds to an element of the specified input sequence ofFile
s.- Parameters:
files
- the locations that will be converted.- Returns:
- a list of
Path
s in which each element corresponds to an element of the input sequence.
-