Package org.eclipse.aether.util
Class PathUtils
java.lang.Object
org.eclipse.aether.util.PathUtils
A reusable utility class for file paths.
- Since:
- 2.0.13
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringstringToPathSegment(String string) Method that makes sure that passed in string is valid "path segment" string.static voidvalidateArtifactComponents(Artifact artifact) Validates all coordinate components of anArtifact.static voidvalidateMetadataComponents(Metadata metadata) Validates all coordinate components of aMetadata.static voidvalidatePathComponent(String value, String label) Validates that a coordinate component does not contain path traversal sequences or path separator characters that could cause the composed path to escape the local repository directory.
-
Method Details
-
stringToPathSegment
Method that makes sure that passed in string is valid "path segment" string. It achieves it by potentially changing it, replacing illegal characters in it with legal ones.Note: this method considers empty string as "valid path segment", it is caller duty to ensure empty string is not used as path segment alone.
This method is simplistic on purpose, and if frequently used, best if results are cached (per session)
-
validatePathComponent
Validates that a coordinate component does not contain path traversal sequences or path separator characters that could cause the composed path to escape the local repository directory.- Since:
- 2.0.21
-
validateArtifactComponents
Validates all coordinate components of anArtifact.- Since:
- 2.0.21
- See Also:
-
validateMetadataComponents
Validates all coordinate components of aMetadata.- Since:
- 2.0.21
- See Also:
-