Revision 3481
Added by barteau about 17 years ago
src/edu/ucsb/nceas/metacat/client/MetacatClient.java | ||
---|---|---|
32 | 32 |
import java.io.StringWriter; |
33 | 33 |
import java.io.Reader; |
34 | 34 |
import java.net.URL; |
35 |
import java.util.HashMap; |
|
35 | 36 |
import java.util.Properties; |
36 | 37 |
import java.util.Vector; |
37 | 38 |
import javax.servlet.http.HttpServletRequest; |
... | ... | |
813 | 814 |
} |
814 | 815 |
} |
815 | 816 |
|
817 |
/** |
|
818 |
* Send a request to Metacat. An alternative to the sentData method. |
|
819 |
* Allows for sending multiple parameters with the same name, |
|
820 |
* different names, or any combo. Send properties where the entry |
|
821 |
* key contains the "param value", |
|
822 |
* and the entry value contains the "param name". |
|
823 |
* Constraint: param values must be unique. |
|
824 |
* |
|
825 |
* @return InputStream as returned by Metacat |
|
826 |
* @param args Properties of the parameters to be sent to Metacat, where, |
|
827 |
* key = param value |
|
828 |
* value = param name |
|
829 |
* @throws java.lang.Exception thrown |
|
830 |
*/ |
|
831 |
synchronized public InputStream sendParameters(Properties args) throws Exception { |
|
832 |
InputStream result = null; |
|
833 |
URL url; |
|
834 |
HttpMessage httpMsg; |
|
835 |
|
|
836 |
url = new URL(metacatUrl); |
|
837 |
httpMsg = new HttpMessage(url); |
|
838 |
httpMsg.setCookie("JSESSIONID="+this.sessionId); |
|
839 |
result = httpMsg.sendPostParameters(args); |
|
840 |
return(result); |
|
841 |
} |
|
842 |
|
|
816 | 843 |
/************************************************************************ |
817 | 844 |
* PRIVATE METHODS |
818 | 845 |
************************************************************************/ |
Also available in: Unified diff
Created method "synchronized public InputStream sendParameters(Properties args) throws Exception".
Sends a request to Metacat. An alternative to the sentData method. Allows for sending multiple parameters with the same name, different names, or any combo.