code: public static String getRelativeFilename(String sourcePath, String baseDir) {
          if (sourcePath.contains(baseDir)) {
              int indexOf = sourcePath.indexOf(baseDir);
  
              if (indexOf + baseDir.length() < sourcePath.length()) {
                  String relative = sourcePath.substring((indexOf + baseDir.length()));
  
                  if (relative.startsWith("/")) {
                      relative = relative.substring(1);
                  }
                  else if (relative.startsWith("\\")) {
                      relative = relative.substring(1);
                  }
  
                  return relative;
              }
          }
  
          return sourcePath;
      }
docs: Removes the base directory from a file path. Leading slashes are also removed from the resulting file path.
  
  @param sourcePath The original file path
  @param baseDir the base directory that should be removed from the original file path
  @return the file path relative to the base directory