java.lang.Object
com.marginallyclever.convenience.PathCalculator

public class PathCalculator extends Object
PathCalculator is a static class that can calculate the relative path between two files.
  • Constructor Details

    • PathCalculator

      public PathCalculator()
  • Method Details

    • getRelativePath

      public static String getRelativePath(String origin, String goal) throws IllegalArgumentException
      Return the relative path from origin to goal.
      Parameters:
      origin - the starting point
      goal - the destination
      Returns:
      the relative path from origin to goal
      Throws:
      IllegalArgumentException - if there is no path from origin to goal.
    • getRelativePath

      public static String getRelativePath(Node origin, Node goal) throws IllegalArgumentException
      Return the relative path from origin to goal.
      Parameters:
      origin - the starting point
      goal - the destination
      Returns:
      the relative path from origin to goal or null if goal is null.
      Throws:
      NullPointerException - if origin is null
      IllegalArgumentException - if there is no path from origin to goal.