@SuppressWarnings("unchecked")
  public String fileLink(String path) throws IOException, InvalidTokenException {
    String url;
    try {
      url =
          getUriBuilder()
              .setPath(API_PATH_PREFIX + "/mounts/primary/files/download")
              .setParameter("path", path)
              .build()
              .toString();
    } catch (URISyntaxException e) {
      throw new IllegalStateException("Could not produce url.", e);
    }

    Request.Builder requestBuilder = getRequestBuilder(url);

    try (Response response = getResponse(requestBuilder)) {
      int code = response.code();
      ResponseBody body = response.body();
      if (code < 200 || code > 299) {
        throw new KoofrClientIOException(response);
      }

      Map<String, Object> responseData = objectMapper.readValue(body.bytes(), Map.class);

      return (String) responseData.get("link");
    }
  }
@Test
  public void testFileLink() throws Exception {
    server.enqueue(
        new MockResponse()
            .setResponseCode(200)
            .setHeader("Content-Type", "application/json")
            .setBody(
                "{\"link\":\"https://app-1.koofr.net/content/files/get/Video+1.mp4?base=TESTBASE\"}"));

    String link = client.fileLink("/Data transfer/Videos/Video 1.mp4");

    assertEquals(
        "https://app-1.koofr.net/content/files/get/Video+1.mp4?base=TESTBASE", link);
  }