Package utils

Class RelativePathGetter

java.lang.Object
utils.RelativePathGetter

public class RelativePathGetter extends Object
This class is used to get the relative path of a file compared to the project path.
  • Constructor Details

    • RelativePathGetter

      public RelativePathGetter()
  • Method Details

    • getRelativePath

      public static String getRelativePath(String absolutePath, String projectPath)
      Get the relative path of a file compared to the project path. If the project path is not a prefix of the file path, the absolute path of the file is returned.
      Parameters:
      absolutePath - The absolute path of the file.
      projectPath - The absolute path of the project.
      Returns:
      The relative path of the file compared to the project path.