/**
  * Returns a GET Method with the http response containing the content of a md-record with the
  * provided name of an escidoc resource with the provided id and the provided resource type.
  *
  * @param resourceId id of the escidoc resource
  * @param resourceType type of the escidoc resource
  * @param mdRecordName provided md-record name
  * @return Get Method
  * @throws RepositoryException
  */
 public static GetMethod requestRetrieveMdRecord(
     final String resourceId, final String resourceType, final String mdRecordName)
     throws RepositoryException {
   String url = null;
   if (escidocUrl.endsWith("/")) {
     url =
         escidocUrl
             + "ir/"
             + resourceType
             + "/"
             + resourceId
             + "/md-records/md-record/"
             + mdRecordName
             + "/content";
   } else {
     url =
         escidocUrl
             + "/ir/"
             + resourceType
             + "/"
             + resourceId
             + "/md-records/md-record/"
             + mdRecordName
             + "/content";
   }
   return utility.get(url);
 }
 /**
  * Returns a GET Method with the http response containing the content of a DC data stream of an
  * escidoc resource with the provided id and the provided resource type.
  *
  * @param resourceId id of the escidoc resource
  * @param resourceType type of the escidoc resource
  * @return Get Method
  * @throws RepositoryException
  */
 public static GetMethod requestRetrieveDc(final String resourceId, final String resourceType)
     throws RepositoryException {
   String url = null;
   if (escidocUrl.endsWith("/")) {
     url = escidocUrl + "ir/" + resourceType + "/" + resourceId + "/resources/dc/content";
   } else {
     url = escidocUrl + "/ir/" + resourceType + "/" + resourceId + "/resources/dc/content";
   }
   return utility.get(url);
 }
 /**
  * Returns a GET Method with the http response containing the result of the invocation of the
  * escidoc method getRepositoryInfo().
  *
  * @return GET Method
  * @throws RepositoryException
  */
 public static GetMethod requestIdentify() throws RepositoryException {
   String url = null;
   HashMap<String, String> params = new HashMap<String, String>();
   if (escidocUrl.endsWith("/")) {
     url = escidocUrl + "adm/admin/get-repository-info";
   } else {
     url = escidocUrl + "/adm/admin/get-repository-info";
   }
   return utility.get(url, params);
 }
  /**
   * Returns a GET Method with the http response containing the result of the search request with
   * the provided query and query parameters.
   *
   * @param params
   * @return GET Method
   * @throws RepositoryException
   */
  public static GetMethod requestSearchQuery(final HashMap<String, String> params)
      throws RepositoryException {
    String url = null;
    if (searchUrl.endsWith("/")) {
      url = searchUrl + "escidocoaipmh_all";
    } else {
      url = searchUrl + "/escidocoaipmh_all";
    }

    return utility.get(url, params);
  }
 /**
  * Returns a GET Method with the http response containing the content of a resource with the
  * provided relative URL of an escidoc resource with the provided id and the provided resource
  * type.
  *
  * @param resourceId id of the escidoc resource
  * @param resourceType type of the escidoc resource
  * @param mdRecordName provided md-record name
  * @return Get Method
  * @throws RepositoryException
  */
 public static GetMethod requestRetrieveResource(
     final String resourceId, final String resourceType, final String suffix)
     throws RepositoryException {
   String resource = suffix.substring("resources".length());
   String url = null;
   if (escidocUrl.endsWith("/")) {
     url = escidocUrl + "ir/" + resourceType + "/" + resourceId + "/resources/" + resource;
   } else {
     url = escidocUrl + "/ir/" + resourceType + "/" + resourceId + "/resources/" + resource;
   }
   return utility.get(url);
 }
  /**
   * Returns a GET Method with the http response containing the result of the invocation of the
   * escidoc method retrieveContexts().
   *
   * @param offset
   * @return GET Method
   * @throws RepositoryException
   */
  public static GetMethod requestRetrieveContexts(final String offset) throws RepositoryException {
    StringBuffer parameters = new StringBuffer("maximumRecords=20");
    if (offset != null && !offset.equals("") && !offset.equals("0")) {
      parameters.append("&startRecord=").append(offset);
    }
    String url = null;
    if (escidocUrl.endsWith("/")) {
      url = escidocUrl + "ir/contexts?" + parameters.toString();
    } else {
      url = escidocUrl + "/ir/contexts?" + parameters.toString();
    }

    return utility.get(url);
  }