es.ucm.look.data.remote
Class ConfigNet

java.lang.Object
  extended by es.ucm.look.data.remote.ConfigNet

public class ConfigNet
extends java.lang.Object

To configure the data remote service. Need a URL for connect the server and another one to download the binaries files.


Method Summary
 java.lang.String getFilesURL(java.lang.String suburl)
          Retrieve the URL of an element from Files
static ConfigNet getInstance()
          Get an unique instance, Singleton class.
 java.lang.String getURL(java.lang.String suburl)
          Retrieve the URL of an element from Server
 boolean isConnected()
          Returns if it exists a server for the app
 void setFilesURL(java.lang.String URL)
          To change the URL files directory.
static void setNetConfiguration(java.lang.String serverUrl, java.lang.String filesURL)
          Sets the server configuration
 void setServerURL(java.lang.String URL)
          To change the server url.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFilesURL

public java.lang.String getFilesURL(java.lang.String suburl)
Retrieve the URL of an element from Files

Parameters:
suburl - Suburl to know the main URL
Returns:
The complete URL

getInstance

public static ConfigNet getInstance()
Get an unique instance, Singleton class.

Returns:

getURL

public java.lang.String getURL(java.lang.String suburl)
Retrieve the URL of an element from Server

Parameters:
suburl - Suburl to know the main URL
Returns:
The complete URL

isConnected

public boolean isConnected()
Returns if it exists a server for the app

Returns:
if it exists a server for the app

setFilesURL

public void setFilesURL(java.lang.String URL)
To change the URL files directory.

Parameters:
URL - New URL

setNetConfiguration

public static void setNetConfiguration(java.lang.String serverUrl,
                                       java.lang.String filesURL)
Sets the server configuration

Parameters:
serverUrl - server url
filesURL - url where files will be downloaded

setServerURL

public void setServerURL(java.lang.String URL)
To change the server url.

Parameters:
URL -