4 import java.io.InputStream;
\r
5 import java.io.IOException;
\r
6 import java.net.MalformedURLException;
\r
8 import java.net.URLConnection;
\r
10 import iotruntime.slave.IoTAddress;
\r
12 /** Class IoTURL is a wrapper class that provides
\r
13 * minimum interfaces for user to interact with IoT
\r
14 * devices in our system
\r
16 * @author Ali Younis <ayounis @ uci.edu>
\r
20 public final class IoTURL {
\r
23 * IoTURL class properties
\r
25 private IoTAddress iotAddress;
\r
26 private URL internalURL;
\r
31 public IoTURL(IoTAddress _iotAddress) {
\r
33 iotAddress = _iotAddress;
\r
40 * @param _strUrlComplete String to complete the URL
\r
43 public void setURL(String _strUrlComplete) throws MalformedURLException {
\r
44 internalURL = new URL(iotAddress.getURL(_strUrlComplete));
\r
48 * getAuthority() method inherited from URL class.
\r
52 public String getAuthority() {
\r
53 return internalURL.getAuthority();
\r
57 * getDefaultPort() method inherited from URL class.
\r
61 public int getDefaultPort() {
\r
62 return internalURL.getDefaultPort();
\r
66 * getFile() method inherited from URL class.
\r
70 public String getFile() {
\r
71 return internalURL.getFile();
\r
75 * getHost() method inherited from URL class.
\r
79 public String getHost() {
\r
80 return internalURL.getHost();
\r
84 * getPath() method inherited from URL class.
\r
88 public String getPath() {
\r
89 return internalURL.getPath();
\r
93 * getPort() method inherited from URL class.
\r
97 public int getPort() {
\r
98 return internalURL.getPort();
\r
102 * getProtocol() method inherited from URL class.
\r
106 public String getProtocol() {
\r
107 return internalURL.getProtocol();
\r
111 * getQuery() method inherited from URL class.
\r
115 public String getQuery() {
\r
116 return internalURL.getQuery();
\r
120 * getRef() method inherited from URL class.
\r
124 public String getRef() {
\r
125 return internalURL.getRef();
\r
129 * getUserInfo() method inherited from URL class.
\r
133 public String getUserInfo() {
\r
134 return internalURL.getUserInfo();
\r
138 * hashCode() method inherited from URL class.
\r
142 public int hashCode() {
\r
143 return internalURL.hashCode();
\r
147 * toExternalForm() method inherited from URL class.
\r
151 public String toExternalForm() {
\r
152 return internalURL.toExternalForm();
\r
156 * toString() method inherited from URL class.
\r
160 public String toString() {
\r
161 return internalURL.toString();
\r
166 * openConnection() method inherited from URL class.
\r
168 * @return URLConnection.
\r
170 public URLConnection openConnection() throws IOException {
\r
171 return internalURL.openConnection();
\r
175 * openStream() method inherited from URL class.
\r
177 * @return InputStream.
\r
179 public InputStream openStream() throws IOException {
\r
180 return internalURL.openStream();
\r
184 * getContent() method inherited from URL class.
\r
188 public Object getContent() throws IOException {
\r
189 return internalURL.getContent();
\r
193 * getContent(Class[] classes) method inherited from URL class.
\r
198 public Object getContent(Class[] classes) throws IOException {
\r
199 return internalURL.getContent(classes);
\r