/**
  * Downloads the documents (in a zip archive) from the package and returns a byte[].
  *
  * @param packageId Id of the DocumentPackage we want to download
  * @return The zipped documents in bytes
  * @throws EslException
  */
 public byte[] downloadZippedDocuments(PackageId packageId) throws EslException {
   String path =
       template.urlFor(UrlTemplate.ZIP_PATH).replace("{packageId}", packageId.getId()).build();
   try {
     return client.getBytes(path).getContents();
   } catch (RequestException e) {
     throw new EslServerException("Could not download the documents to a zip file.", e);
   } catch (Exception e) {
     throw new EslException("Could not download the documents to a zip file.", e);
   }
 }
  /**
   * Get Journal Entries in csv format.
   *
   * @param userId The ID of the user whose e-journal entries are being retrieved.
   * @return all of the user's notary e-journal entries in csv format.
   */
  public DownloadedFile getJournalEntriesAsCSV(String userId) {
    String path =
        template.urlFor(UrlTemplate.NOTARY_JOURNAL_CSV_PATH).replace("{userId}", userId).build();

    try {
      return client.getBytes(path);
    } catch (RequestException e) {
      throw new EslException("Could not get Journal Entries in csv.", e);
    } catch (Exception e) {
      throw new EslException(
          "Could not get Journal Entries in csv." + " Exception: " + e.getMessage());
    }
  }
 /**
  * Downloads the evidence summary (in PDF) from the package and returns a byte[].
  *
  * @param packageId
  * @return The evidence summary in bytes
  * @throws EslException
  */
 public byte[] downloadEvidenceSummary(PackageId packageId) throws EslException {
   String path =
       template
           .urlFor(UrlTemplate.EVIDENCE_SUMMARY_PATH)
           .replace("{packageId}", packageId.getId())
           .build();
   try {
     return client.getBytes(path).getContents();
   } catch (RequestException e) {
     throw new EslServerException("Could not download the evidence summary.", e);
   } catch (Exception e) {
     throw new EslException("Could not download the evidence summary.", e);
   }
 }