|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object it.geosolutions.geoserver.rest.HTTPUtils
public class HTTPUtils
Low level HTTP utilities.
Constructor Summary | |
---|---|
HTTPUtils()
|
Method Summary | |
---|---|
static StringBuffer |
append(String... str)
|
static StringBuffer |
append(URL base,
String... str)
Wrapper for append(String...) |
static String |
decurtSlash(String geoserverURL)
|
static boolean |
delete(String url,
String user,
String pw)
|
static boolean |
exists(String url,
String username,
String pw)
Used to query for REST resources. |
static String |
get(String url)
Performs an HTTP GET on the given URL. |
static String |
get(String url,
String username,
String pw)
Performs an HTTP GET on the given URL. |
static boolean |
httpPing(String url)
|
static boolean |
httpPing(String url,
String username,
String pw)
|
static String |
post(String url,
File file,
String contentType,
String username,
String pw)
POSTs a File to the given URL. |
static String |
post(String url,
org.apache.commons.httpclient.methods.RequestEntity requestEntity,
String username,
String pw)
Performs a POST to the given URL. |
static String |
post(String url,
String content,
String contentType,
String username,
String pw)
POSTs a String to the given URL. |
static String |
postXml(String url,
String content,
String username,
String pw)
POSTs a String representing an XML document to the given URL. |
static String |
put(String url,
File file,
String contentType,
String username,
String pw)
PUTs a File to the given URL. |
static String |
put(String url,
org.apache.commons.httpclient.methods.RequestEntity requestEntity,
String username,
String pw)
Performs a PUT to the given URL. |
static String |
put(String url,
String content,
String contentType,
String username,
String pw)
PUTs a String to the given URL. |
static String |
putXml(String url,
String content,
String username,
String pw)
PUTs a String representing an XML document to the given URL. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HTTPUtils()
Method Detail |
---|
public static String get(String url) throws MalformedURLException
url
- The URL where to connect to.
MalformedURLException
public static String get(String url, String username, String pw) throws MalformedURLException
url
- The URL where to connect to.username
- Basic auth credential. No basic auth if null.pw
- Basic auth credential. No basic auth if null.
MalformedURLException
public static String put(String url, File file, String contentType, String username, String pw)
url
- The URL where to connect to.file
- The File to be sent.contentType
- The content-type to advert in the PUT.username
- Basic auth credential. No basic auth if null.pw
- Basic auth credential. No basic auth if null.
MalformedURLException
public static String put(String url, String content, String contentType, String username, String pw)
url
- The URL where to connect to.content
- The content to be sent as a String.contentType
- The content-type to advert in the PUT.username
- Basic auth credential. No basic auth if null.pw
- Basic auth credential. No basic auth if null.
MalformedURLException
public static String putXml(String url, String content, String username, String pw)
url
- The URL where to connect to.content
- The XML content to be sent as a String.username
- Basic auth credential. No basic auth if null.pw
- Basic auth credential. No basic auth if null.
MalformedURLException
public static String put(String url, org.apache.commons.httpclient.methods.RequestEntity requestEntity, String username, String pw)
url
- The URL where to connect to.requestEntity
- The request to be sent.username
- Basic auth credential. No basic auth if null.pw
- Basic auth credential. No basic auth if null.
MalformedURLException
public static String post(String url, File file, String contentType, String username, String pw)
url
- The URL where to connect to.file
- The File to be sent.contentType
- The content-type to advert in the POST.username
- Basic auth credential. No basic auth if null.pw
- Basic auth credential. No basic auth if null.
MalformedURLException
public static String post(String url, String content, String contentType, String username, String pw)
url
- The URL where to connect to.content
- The content to be sent as a String.contentType
- The content-type to advert in the POST.username
- Basic auth credential. No basic auth if null.pw
- Basic auth credential. No basic auth if null.
MalformedURLException
public static String postXml(String url, String content, String username, String pw)
url
- The URL where to connect to.content
- The XML content to be sent as a String.username
- Basic auth credential. No basic auth if null.pw
- Basic auth credential. No basic auth if null.
MalformedURLException
public static String post(String url, org.apache.commons.httpclient.methods.RequestEntity requestEntity, String username, String pw)
url
- The URL where to connect to.requestEntity
- The request to be sent.username
- Basic auth credential. No basic auth if null.pw
- Basic auth credential. No basic auth if null.
MalformedURLException
public static boolean delete(String url, String user, String pw)
public static boolean httpPing(String url)
public static boolean httpPing(String url, String username, String pw)
public static boolean exists(String url, String username, String pw)
url
- The URL of the REST resource to query about.username
- pw
-
RuntimeException
- on unhandled status or exceptions.public static String decurtSlash(String geoserverURL)
geoserverURL
-
public static StringBuffer append(String... str)
str
- a string array
public static StringBuffer append(URL base, String... str)
append(String...)
base
- base URLstr
- strings to append
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |