Load document from FTP

Following example demonstrates how to render a document from FTP.

    public void loadDocumentFromFtp() {
        try (Viewer viewer = new Viewer(getFileFromFtp("sample.docx"))) {
            HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources();
            viewer.view(viewOptions);
        }
    }

    private InputStream getFileFromFtp(String filePath) {
        URI uri = new URI(filePath);
        FtpWebRequest request = createRequest(uri);
        WebResponse response = request.getResponse()
        return getFileStream(response);
    }

    private FtpWebRequest createRequest(URI uri) {
        FtpWebRequest request = (FtpWebRequest) WebRequest.create(uri);
        request.setMethod(WebRequestMethods.Ftp.DOWNLOAD_FILE);
        return request;
    }

    private InputStream getFileStream(WebResponse response) {
        return response.getResponseStream();
    }