This is an automated email from the ASF dual-hosted git repository.
elharo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-shared-utils.git
The following commit(s) were added to refs/heads/master by this push:
new 60c7f31 Deprecate PathTool (#355)
60c7f31 is described below
commit 60c7f3186d40e3e4972c81cf5ce948b96bd255bf
Author: Elliotte Rusty Harold <[email protected]>
AuthorDate: Wed Dec 10 22:10:06 2025 +0000
Deprecate PathTool (#355)
---
src/main/java/org/apache/maven/shared/utils/PathTool.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/maven/shared/utils/PathTool.java
b/src/main/java/org/apache/maven/shared/utils/PathTool.java
index bf0fd49..6338a93 100644
--- a/src/main/java/org/apache/maven/shared/utils/PathTool.java
+++ b/src/main/java/org/apache/maven/shared/utils/PathTool.java
@@ -33,6 +33,7 @@ import java.util.StringTokenizer;
* Some external fixes by Apache Committers have been applied later.
* </p>
*/
+@Deprecated
public class PathTool {
/**
@@ -46,7 +47,7 @@ public class PathTool {
/**
* Determines the relative path of a filename from a base directory.
* This method is useful in building relative links within pages of
- * a web site. It provides similar functionality to Anakia's
+ * a website. It provides similar functionality to Anakia's
* <code>$relativePath</code> context variable. The arguments to
* this method may contain either forward or backward slashes as
* file separators. The relative path returned is formed using
@@ -67,12 +68,14 @@ public class PathTool {
* @param basedir The base directory.
* @param filename The filename that is relative to the base
* directory.
- * @return The relative path of the filename from the base
+ * @return the relative path of the filename from the base
* directory. This value is not terminated with a forward slash.
* A zero-length string is returned if: the filename is not
relative to
* the base directory, <code>basedir</code> is null or zero-length,
* or <code>filename</code> is null or zero-length.
+ * @deprecated use java.nio.file.Path.relativize() instead
*/
+ @Deprecated
public static String getRelativePath(@Nullable String basedir, @Nullable
String filename) {
basedir = uppercaseDrive(basedir);
filename = uppercaseDrive(filename);
@@ -127,7 +130,9 @@ public class PathTool {
* @param oldPath old path
* @param newPath new path
* @return a relative file path from <code>oldPath</code>.
+ * @deprecated use java.nio.file.Path.relativize() instead
*/
+ @Deprecated
public static String getRelativeFilePath(final String oldPath, final
String newPath) {
if (StringUtils.isEmpty(oldPath) || StringUtils.isEmpty(newPath)) {
return "";