org.h2gis.utilities
Class URIUtility

java.lang.Object
  extended by org.h2gis.utilities.URIUtility

public class URIUtility
extends Object

Utility class in order to manage URI

Author:
Nicolas Fortin

Field Summary
static String ENCODING
           
 
Constructor Summary
URIUtility()
           
 
Method Summary
static File fileFromString(String fileName)
           
static String getConcatenatedParameters(Map<String,String> parameters, String... keys)
          Create the Query part of an URI
static Map<String,String> getQueryKeyValuePairs(URI uri)
          Read the Query part of an URI.
static URI relativize(URI base, URI target)
          Enhanced version of URI.relativize, the target can now be in parent folder of base URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENCODING

public static final String ENCODING
See Also:
Constant Field Values
Constructor Detail

URIUtility

public URIUtility()
Method Detail

getQueryKeyValuePairs

public static Map<String,String> getQueryKeyValuePairs(URI uri)
                                                throws UnsupportedEncodingException
Read the Query part of an URI.

Parameters:
uri - URI to split
Returns:
Key/Value pairs of query, the key is lowercase and value may be null
Throws:
UnsupportedEncodingException

getConcatenatedParameters

public static String getConcatenatedParameters(Map<String,String> parameters,
                                               String... keys)
Create the Query part of an URI

Parameters:
parameters - Parameters to read
keys - map property to read
Returns:
Query part of an URI

relativize

public static URI relativize(URI base,
                             URI target)
Enhanced version of URI.relativize, the target can now be in parent folder of base URI.

Parameters:
base - Base uri, location from where to relativize.
target - Target uri, final destination of returned URI.
Returns:
Non-absolute URI, or target if target scheme is different than base scheme.
Throws:
IllegalArgumentException

fileFromString

public static File fileFromString(String fileName)
Parameters:
fileName - File name using Path or URI
Returns:
File path


Copyright © 2015 IRSTV CNRS-FR-2488. All Rights Reserved.