Examples of NameValuePair


Examples of org.apache.commons.httpclient.NameValuePair

      httpClient.executeMethod(authget);
      int statuscode = authget.getStatusCode();

      authpost = new PostMethod(securityHost + "/j_security_check");
      NameValuePair j_username = new NameValuePair("j_username", userName);
      NameValuePair j_password = new NameValuePair("j_password", password);
      authpost.setRequestBody(new NameValuePair[] { j_username, j_password });

      httpClient.executeMethod(authpost);
      statuscode = authpost.getStatusCode();
      if ((statuscode == HttpStatus.SC_MOVED_TEMPORARILY)
View Full Code Here

Examples of org.apache.commons.httpclient.NameValuePair

      value = XMLHelper.getNodeText(nodes.item(i));
      if (value == null)
      {
        value = "";
      }
      params.add(new NameValuePair(name, value));
    }

    /*
     * Copy WILDCARDS from XBUSSystem into parameters
     */
    Hashtable info = mDestination.getAddresses();
    String key = null;
    for (Enumeration en = info.keys(); en.hasMoreElements();)
    {
      key = (String) en.nextElement();
      if (XBUSSystem.FILENAME_WILDCARD.equals(key))
      {
        value = (String) info.get(key);
        params.add(new NameValuePair(key, value));
      }
    }

    NameValuePair[] paramArray = new NameValuePair[params.size()];
    params.copyInto(paramArray);
View Full Code Here

Examples of org.apache.commons.httpclient.NameValuePair

    }
  }

  private String getProxyTicket(String casServer, String pgt, String targetServiceURL) {
    try {
      NameValuePair pgtParam = new NameValuePair("pgt", pgt);
      NameValuePair serviceParam = new NameValuePair("targetService", targetServiceURL);

      GetMethod proxyMethod = new GetMethod(casServer + "proxy");
      proxyMethod.setQueryString(new NameValuePair[] { pgtParam, serviceParam });

      int status = pool.httpClient.executeMethod(proxyMethod);
View Full Code Here

Examples of org.apache.commons.httpclient.NameValuePair

    return null;
  }

  private String startRemoteSession(String sessionURL, String proxyTicket, Session localSession) {
    try {
      NameValuePair ticketParam = new NameValuePair("ticket", proxyTicket);
      GetMethod sessionMethod = new GetMethod(sessionURL);
      sessionMethod.setQueryString(new NameValuePair[] { ticketParam });

      int status = pool.httpClient.executeMethod(sessionMethod);
View Full Code Here

Examples of org.apache.commons.httpclient.NameValuePair

  }

  private List<NameValuePair> getQueryParams() {
    List<NameValuePair> queryParams = new ArrayList<NameValuePair>(bindings.size() + 10);

    queryParams.add(new NameValuePair(Protocol.INCLUDE_INFERRED_PARAM_NAME,
        Boolean.toString(includeInferred)));

    if (dataset != null) {
      for (URI defaultGraphURI : dataset.getDefaultGraphs()) {
        queryParams.add(new NameValuePair(Protocol.DEFAULT_GRAPH_PARAM_NAME, defaultGraphURI.toString()));
      }
      for (URI namedGraphURI : dataset.getNamedGraphs()) {
        queryParams.add(new NameValuePair(Protocol.NAMED_GRAPH_PARAM_NAME, namedGraphURI.toString()));
      }
    }

    if (offset > 0) {
      queryParams.add(new NameValuePair(Protocol.OFFSET, String.valueOf(offset)));
    }
    if (limit >= 0) {
      queryParams.add(new NameValuePair(Protocol.LIMIT, String.valueOf(limit)));
    }

    for (Binding binding : bindings) {
      String paramName = Protocol.BINDING_PREFIX + binding.getName();
      String paramValue = Protocol.encodeValue(binding.getValue());
      queryParams.add(new NameValuePair(paramName, paramValue));
    }

    return queryParams;
  }
View Full Code Here

Examples of org.apache.commons.httpclient.NameValuePair

  private List<NameValuePair> getQueryParams(QueryLanguage ql, String query, String baseURI) {
    List<NameValuePair> queryParams = new ArrayList<NameValuePair>();

    if (ql != null) {
      queryParams.add(new NameValuePair(Protocol.QUERY_LANGUAGE_PARAM_NAME, ql.getName()));
    }
    if (baseURI != null) {
      queryParams.add(new NameValuePair(Protocol.BASEURI_PARAM_NAME, baseURI));
    }

    queryParams.add(new NameValuePair(Protocol.QUERY_PARAM_NAME, query));
    return queryParams;
  }
View Full Code Here

Examples of org.apache.commons.httpclient.NameValuePair

    }

    // Set relevant query parameters
    List<NameValuePair> params = new ArrayList<NameValuePair>(5);
    for (String encodedContext : Protocol.encodeContexts(contexts)) {
      params.add(new NameValuePair(Protocol.CONTEXT_PARAM_NAME, encodedContext));
    }
    if (baseURI != null && baseURI.trim().length() != 0) {
      String encodedBaseURI = Protocol.encodeValue(new URIImpl(baseURI));
      params.add(new NameValuePair(Protocol.BASEURI_PARAM_NAME, encodedBaseURI));
    }
    request.sendQueryString(params);

    // Set payload
    request.sendEntity(reqEntity);
View Full Code Here

Examples of org.apache.commons.httpclient.NameValuePair

  private List<NameValuePair> getParams(Resource subj, URI pred, Value obj, boolean includeInferred,
      Resource... contexts)
  {
    List<NameValuePair> params = new ArrayList<NameValuePair>(5);
    if (subj != null) {
      params.add(new NameValuePair(Protocol.SUBJECT_PARAM_NAME, Protocol.encodeValue(subj)));
    }
    if (pred != null) {
      params.add(new NameValuePair(Protocol.PREDICATE_PARAM_NAME, Protocol.encodeValue(pred)));
    }
    if (obj != null) {
      params.add(new NameValuePair(Protocol.OBJECT_PARAM_NAME, Protocol.encodeValue(obj)));
    }
    for (String encodedContext : Protocol.encodeContexts(contexts)) {
      params.add(new NameValuePair(Protocol.CONTEXT_PARAM_NAME, encodedContext));
    }
    params.add(new NameValuePair(Protocol.INCLUDE_INFERRED_PARAM_NAME, Boolean.toString(includeInferred)));
    if (limit != null) {
      params.add(new NameValuePair(Protocol.LIMIT, String.valueOf(limit)));
    }
    return params;
  }
View Full Code Here

Examples of org.apache.commons.httpclient.NameValuePair

  private List<NameValuePair> getParams(Resource subj, URI pred, Value obj, boolean includeInferred,
      Resource... contexts)
  {
    List<NameValuePair> params = new ArrayList<NameValuePair>(5);
    if (subj != null) {
      params.add(new NameValuePair(Protocol.SUBJECT_PARAM_NAME, Protocol.encodeValue(subj)));
    }
    if (pred != null) {
      params.add(new NameValuePair(Protocol.PREDICATE_PARAM_NAME, Protocol.encodeValue(pred)));
    }
    if (obj != null) {
      params.add(new NameValuePair(Protocol.OBJECT_PARAM_NAME, Protocol.encodeValue(obj)));
    }
    for (String encodedContext : Protocol.encodeContexts(contexts)) {
      params.add(new NameValuePair(Protocol.CONTEXT_PARAM_NAME, encodedContext));
    }
    params.add(new NameValuePair(Protocol.INCLUDE_INFERRED_PARAM_NAME, Boolean.toString(includeInferred)));
    return params;
  }
View Full Code Here

Examples of org.apache.commons.httpclient.NameValuePair

  public TupleResult post(int amount)
    throws StoreException, QueryResultParseException, NoCompatibleMediaType
  {
    HTTPRequest request = pool.post();

    NameValuePair pair = new NameValuePair(AMOUNT, valueOf(amount));
    request.sendQueryString(Arrays.asList(pair));

    try {
      request.acceptTupleQueryResult();
      execute(request);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.