code: static String createRelativeUri(File file, File output) {
      if (file == null) {
        return null;
      }
      try {
        file = file.getCanonicalFile();
        output = output.getCanonicalFile();
        if (file.equals(output)) {
          throw new IllegalArgumentException("File path and output folder are the same.");
        }
        StringBuilder builder = new StringBuilder();
        while (!file.equals(output)) {
          if (builder.length() > 0) {
            builder.insert(0, "/");
          }
          builder.insert(0, file.getName());
          file = file.getParentFile().getCanonicalFile();
        }
        return builder.toString();
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
docs: Get a relative URI for {@code file} from {@code output} folder.