org.omnaest.utils.download
Class URIHelper

java.lang.Object
  extended by org.omnaest.utils.download.URIHelper

public class URIHelper
extends Object


Constructor Summary
URIHelper()
           
 
Method Summary
static URI createUri(String location)
          Creates a new URI based on the given location
static URI createURI(String scheme, String host, String path, String... queryParameters)
          Creates a new uri instance with the given parameters.
static URI createUri(URI baseAddress, String relativePath)
          Creates a new Uri which is based on the given base address and a relative path
static URL getURLfromURI(URI uri)
          Returns an url for a given uri if possible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URIHelper

public URIHelper()
Method Detail

createURI

public static URI createURI(String scheme,
                            String host,
                            String path,
                            String... queryParameters)
Creates a new uri instance with the given parameters.

Parameters:
scheme - : e.g. "http"
host - : e.g. "www.google.de"
path - : e.g. "search/subsearch"
queryParameters - : e.g. "key1=value1", "key2=value2"
Returns:
URI
See Also:
URI#URI(String, String, String, String, String))

createUri

public static URI createUri(String location)
Creates a new URI based on the given location

Parameters:
location -
Returns:

createUri

public static URI createUri(URI baseAddress,
                            String relativePath)
Creates a new Uri which is based on the given base address and a relative path

Parameters:
baseAddress -
relativePath -
Returns:

getURLfromURI

public static URL getURLfromURI(URI uri)
Returns an url for a given uri if possible. Otherwise null is returned.

Parameters:
uri -
Returns:


Copyright © 2013. All Rights Reserved.