Android Open Source - gm-httpengine-studio G M Http Parameters






From Project

Back to project page gm-httpengine-studio.

License

The source code is released under:

GNU Lesser General Public License

If you think the Android project gm-httpengine-studio listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.gemini.httpengine.library;
/*www  .  j  a va  2s.  c  om*/
import java.io.File;
import java.util.Collection;
import java.util.Collections;
import java.util.Set;
import java.util.TreeMap;

/**
 * http parameter collection
 */
public class GMHttpParameters {
  private TreeMap<String, Object> httpParameters;
    private boolean binaryData = false;

  public GMHttpParameters() {
        httpParameters = new TreeMap<String, Object>();
  }

  public GMHttpParameters(GMHttpParameters other) {
    this.httpParameters = new TreeMap<String, Object>(other.httpParameters);
  }

  public Object getParameter(String name) {
        return httpParameters.get(name);
  }

    public GMHttpParameters setParameter(String name, String value) {
        if (value != null) {
            httpParameters.put(name, value);
        }
        return this;
    }

    public GMHttpParameters setParameter(String name, File value) {
        if (value != null) {
            binaryData = true;
            httpParameters.put(name, value);
        }
        return this;
    }

    public boolean isBinaryContent() {
        return this.binaryData;
    }

    public Object removeParameter(String name) {
        return this.httpParameters.remove(name);
    }

  public Set<String> getNames() {
        return httpParameters.keySet();
  }

  @Override
  public String toString() {
        return httpParameters.toString();
  }

}




Java Source Code List

org.gemini.httpengine.examples.LoginAPI.java
org.gemini.httpengine.examples.MainActivity.java
org.gemini.httpengine.library.Config.java
org.gemini.httpengine.library.FormUrlEncodedParser.java
org.gemini.httpengine.library.GMHttpEngine.java
org.gemini.httpengine.library.GMHttpException.java
org.gemini.httpengine.library.GMHttpLoader.java
org.gemini.httpengine.library.GMHttpMethodExecutor.java
org.gemini.httpengine.library.GMHttpParameters.java
org.gemini.httpengine.library.GMHttpRequest.java
org.gemini.httpengine.library.GMHttpResponse.java
org.gemini.httpengine.library.GMHttpResult.java
org.gemini.httpengine.library.GMHttpService.java
org.gemini.httpengine.library.GMModelParser.java
org.gemini.httpengine.library.GMTrustManager.java
org.gemini.httpengine.library.HttpMethod.java
org.gemini.httpengine.library.HttpParameter.java
org.gemini.httpengine.library.HttpRequestParser.java
org.gemini.httpengine.library.HttpResponseParser.java
org.gemini.httpengine.library.LOG.java
org.gemini.httpengine.library.MultiPartParser.java
org.gemini.httpengine.library.MultipartEntity.java
org.gemini.httpengine.library.OnProgressUpdateListener.java
org.gemini.httpengine.library.OnResponseListener.java