|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.core.utils.HttpUtils
Provides convenience methods for use the HTTP POST method.
Field Summary | |
static int |
DEFAULT_POST_BUFFER_SIZE
Default buffer size for reading data. |
Constructor Summary | |
private |
HttpUtils()
Private constructor so this class will not be instantiated. |
Method Summary | |
static java.io.InputStream |
post(java.net.URL url,
java.io.InputStream dataStream)
Post a given InputStream s data to a URL. |
static java.io.InputStream |
post(java.net.URL url,
java.io.InputStream dataStream,
java.lang.String username,
java.lang.String password)
Post a given InputStream s data to a URL using BASIC
authentication and the given username and password. |
static java.io.InputStream |
post(java.net.URL url,
java.io.InputStream dataStream,
java.lang.String username,
java.lang.String password,
int bufSize)
Post a given InputStream s data to a URL using BASIC
authentication, the given username and password, and a buffer size. |
static java.io.InputStream |
post(java.net.URL url,
java.io.Reader dataReader,
java.lang.String username,
java.lang.String password,
int bufSize)
Post a given Reader s data to a URL using BASIC
authentication, the given username and password, and a buffer size. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_POST_BUFFER_SIZE
Constructor Detail |
private HttpUtils()
Method Detail |
public static java.io.InputStream post(java.net.URL url, java.io.InputStream dataStream) throws java.io.IOException
InputStream
s data to a URL.
url
- the URL
to post todataStream
- an input stream containing the data to send
InputStream that the programmer can read from
to get the HTTP server's response.
- Throws:
java.io.IOException
public static java.io.InputStream post(java.net.URL url, java.io.InputStream dataStream, java.lang.String username, java.lang.String password) throws java.io.IOException
InputStream
s data to a URL using BASIC
authentication and the given username and password.
url
- the URL
to post todataStream
- an input stream containing the data to sendusername
- the username to use in the BASIC authenticationpassword
- the password to use in the BASIC authentication
InputStream that the programmer can read from
to get the HTTP server's response.
- Throws:
java.io.IOException
public static java.io.InputStream post(java.net.URL url, java.io.InputStream dataStream, java.lang.String username, java.lang.String password, int bufSize) throws java.io.IOException
InputStream
s data to a URL using BASIC
authentication, the given username and password, and a buffer size.
url
- the URL
to post todataStream
- an input stream containing the data to sendusername
- the username to use in the BASIC authenticationpassword
- the password to use in the BASIC authenticationbufSize
- the size of the buffer to read from dataStream
and write to the HTTP server
InputStream that the programmer can read from
to get the HTTP server's response.
- Throws:
java.io.IOException
public static java.io.InputStream post(java.net.URL url, java.io.Reader dataReader, java.lang.String username, java.lang.String password, int bufSize) throws java.io.IOException
Reader
s data to a URL using BASIC
authentication, the given username and password, and a buffer size.
url
- the URL
to post todataReader
- an input reader containing the data to sendusername
- the username to use in the BASIC authenticationpassword
- the password to use in the BASIC authenticationbufSize
- the size of the buffer to read from dataStream
and write to the HTTP server
InputStream that the programmer can read from
to get the HTTP server's response.
- Throws:
java.io.IOException
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |