FileDocCategorySizeDatePackage
QueryString.javaAPI DocExample587Sat Sep 09 19:54:42 BST 2000com.macfaq.net

QueryString.java

package com.macfaq.net;

import java.net.URLEncoder;

public class QueryString {

  private String query;

  public QueryString(Object name, Object value) {
    query = URLEncoder.encode(name.toString()) + "=" + 
      URLEncoder.encode(value.toString());
  }
  
  public QueryString() {
    query = "";
  }
  
  public synchronized void add(Object name, Object value) {
  
    if (!query.trim().equals("")) query += "&" ; 
    query += URLEncoder.encode(name.toString()) + "=" + 
     URLEncoder.encode(value.toString());
  
  }
  
  public String toString() {
    return query;
  }

}