Package be.ceau.itunesapi.http
Class URLConnector
- java.lang.Object
-
- be.ceau.itunesapi.http.URLConnector
-
- All Implemented Interfaces:
Connector,Serializable
public class URLConnector extends Object implements Connector, Serializable
DefaultConnectorimplementation usingURLConnection.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static URLConnectorINSTANCEReusable, threadsafeURLConnectorinstance.
-
Constructor Summary
Constructors Constructor Description URLConnector()
-
-
-
Field Detail
-
INSTANCE
public static final URLConnector INSTANCE
Reusable, threadsafeURLConnectorinstance.
-
-
Method Detail
-
get
public String get(String link) throws IOException
Perform an HTTP request. Return the response body asString.- Specified by:
getin interfaceConnector- Parameters:
link- a full link, including scheme- Returns:
- server response body as
String, nevernull - Throws:
MalformedURLException- as thrown byURL(String)IOException- if a problem occurred with the connection
-
-