/**
  * Deletes the document from the package.
  *
  * @param packageId
  * @param documentId
  * @throws EslException
  */
 public void deleteDocument(PackageId packageId, String documentId) throws EslException {
   String path =
       template
           .urlFor(UrlTemplate.DOCUMENT_ID_PATH)
           .replace("{packageId}", packageId.getId())
           .replace("{documentId}", documentId)
           .build();
   try {
     client.delete(path);
   } catch (RequestException e) {
     throw new EslServerException("Could not delete document from package.", e);
   } catch (Exception e) {
     throw new EslException("Could not delete document from package.", e);
   }
 }
 /**
  * Deletes a role from the package.
  *
  * @param packageId
  * @param role
  * @throws EslException
  */
 public void deleteRole(PackageId packageId, Role role) throws EslException {
   String path =
       template
           .urlFor(UrlTemplate.ROLE_ID_PATH)
           .replace("{packageId}", packageId.getId())
           .replace("{roleId}", role.getId())
           .build();
   try {
     client.delete(path);
   } catch (RequestException e) {
     throw new EslServerException("Could not delete role", e);
   } catch (Exception e) {
     throw new EslException("Could not delete role", e);
   }
 }
  /**
   * Deletes the specified package.
   *
   * @param packageId The id of the package to be deleted
   */
  public void deletePackage(PackageId packageId) {
    String path =
        template
            .urlFor(UrlTemplate.PACKAGE_ID_PATH)
            .replace("{packageId}", packageId.getId())
            .build();

    try {
      client.delete(path);
    } catch (RequestException e) {
      throw new EslServerException("Unable to delete package.", e);
    } catch (Exception e) {
      e.printStackTrace();
      throw new EslException("Unable to delete package. Exception: " + e.getMessage());
    }
  }
 /**
  * Removes a signer from a package
  *
  * @param packageId The id of the package containing the signer to be deleted
  * @param signerId The role id of the signer to be deleted
  */
 public void removeSigner(PackageId packageId, String signerId) {
   String path =
       template
           .urlFor(UrlTemplate.SIGNER_PATH)
           .replace("{packageId}", packageId.getId())
           .replace("{roleId}", signerId)
           .build();
   try {
     client.delete(path);
     return;
   } catch (RequestException e) {
     throw new EslServerException("Could not delete signer.", e);
   } catch (Exception e) {
     throw new EslException("Could not delete signer." + " Exception: " + e.getMessage());
   }
 }