aa5d2bea39232da637987719be4e870d430a2a35.svn-base 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
  2. // Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
  3. // Decompiler options: packimports(3) fieldsfirst ansi
  4. // Source File Name: Request.java
  5. package com.sinosoft.common.upLoad.util;
  6. import java.util.Enumeration;
  7. import java.util.Hashtable;
  8. public class Request{
  9. @SuppressWarnings("rawtypes")
  10. private Hashtable m_parameters;
  11. @SuppressWarnings("unused")
  12. private int m_counter;
  13. @SuppressWarnings("rawtypes")
  14. Request() {
  15. m_parameters = new Hashtable();
  16. m_counter = 0;
  17. }
  18. @SuppressWarnings({ "unchecked", "rawtypes" })
  19. protected void putParameter(String name, String value) {
  20. if (name == null)
  21. throw new IllegalArgumentException("The name of an element cannot be null.");
  22. if (m_parameters.containsKey(name)) {
  23. Hashtable values = (Hashtable) m_parameters.get(name);
  24. values.put(new Integer(values.size()), value);
  25. } else {
  26. Hashtable values = new Hashtable();
  27. values.put(new Integer(0), value);
  28. m_parameters.put(name, values);
  29. m_counter++;
  30. }
  31. }
  32. @SuppressWarnings("rawtypes")
  33. public String getParameter(String name) {
  34. if (name == null)
  35. throw new IllegalArgumentException("Form's name is invalid or does not exist (1305).");
  36. Hashtable values = (Hashtable) m_parameters.get(name);
  37. if (values == null)
  38. return null;
  39. else
  40. return (String) values.get(new Integer(0));
  41. }
  42. @SuppressWarnings("rawtypes")
  43. public Enumeration getParameterNames() {
  44. return m_parameters.keys();
  45. }
  46. @SuppressWarnings("rawtypes")
  47. public String[] getParameterValues(String name) {
  48. if (name == null)
  49. throw new IllegalArgumentException("Form's name is invalid or does not exist (1305).");
  50. Hashtable values = (Hashtable) m_parameters.get(name);
  51. if (values == null)
  52. return null;
  53. String strValues[] = new String[values.size()];
  54. for (int i = 0; i < values.size(); i++)
  55. strValues[i] = (String) values.get(new Integer(i));
  56. return strValues;
  57. }
  58. }