package model;

/**
 * References a file in Filestack.
 */
public class FileLink {
    private String handle;

    /**
     * @param apiKey Get from the Developer Portal.
     * @param handle A handle is returned after a file upload.
     */
    public FileLink(String apiKey, String handle) {
        this.handle = handle;
    }

    public String getHandle() {
        return handle;
    }
}

@@ -9,16 +9,212 @@
 model;%0A%0A
+import okhttp3.ResponseBody;%0Aimport okio.BufferedSink;%0Aimport okio.BufferedSource;%0Aimport okio.Okio;%0Aimport retrofit2.Response;%0Aimport util.CdnService;%0Aimport util.Networking;%0A%0Aimport java.io.*;%0A%0A
 /**%0A * R
@@ -272,16 +272,78 @@
 eLink %7B%0A
+    private CdnService CdnService;%0A    private String apiKey;%0A
     priv
@@ -562,21 +562,907 @@
 his.
-handle = hand
+apiKey = apiKey;%0A        this.handle = handle;%0A%0A        this.CdnService = Networking.getCdnService();%0A    %7D%0A%0A    public ResponseBody getContent() throws IOException %7B%0A        return CdnService.get(this.handle).execute().body();%0A    %7D%0A%0A    public File download(String directory) throws IOException %7B%0A        return download(directory, null);%0A    %7D%0A%0A    public File download(String directory, String filename) throws IOException %7B%0A        Response%3CResponseBody%3E response = CdnService.get(this.handle).execute();%0A%0A        if (filename == null)%0A            filename = response.headers().get(%22x-file-name%22);%0A%0A        File file = new File(directory + %22/%22 + filename);%0A        boolean created = file.createNewFile();%0A%0A        BufferedSource source = response.body().source();%0A        BufferedSink sink = Okio.buffer(Okio.sink(file));%0A%0A        sink.writeAll(source);%0A        sink.close();%0A%0A        return fi
 le;%0A

Add download() and getContent() methods.