org.eclipse.egit.github.core.util
Class UrlUtils

java.lang.Object
  extended by org.eclipse.egit.github.core.util.UrlUtils

public abstract class UrlUtils
extends Object

URL utilities


Constructor Summary
UrlUtils()
           
 
Method Summary
static void addParam(String name, String value, StringBuilder uri)
          Add encoded parameter to URI
static void addParams(Map<String,String> params, StringBuilder uri)
          Add request parameters to URI
static String createRemoteHttpsUrl(IRepositoryIdProvider repository, String user)
          Create HTTPS URL used for repository remote configs
static String createRemoteHttpsUrl(IRepositoryIdProvider repository, String host, String user)
          Create HTTPS URL used for repository remote configs
static String createRemoteReadOnlyUrl(IRepositoryIdProvider repository)
          Create read-only URL used for repository remote configs
static String createRemoteReadOnlyUrl(IRepositoryIdProvider repository, String host)
          Create read-only URL used for repository remote configs
static String createRemoteSshUrl(IRepositoryIdProvider repository)
          Create SSH URL used for repository remote configs
static String createRemoteSshUrl(IRepositoryIdProvider repository, String host)
          Create SSH URL used for repository remote configs
static String decode(String value)
          URL-decode value using 'ISO-8859-1' character set
static String encode(String value)
          URL-encode value using 'ISO-8859-1' character set
static String getParam(URI uri, String name)
          Get parameter value with name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UrlUtils

public UrlUtils()
Method Detail

createRemoteSshUrl

public static String createRemoteSshUrl(IRepositoryIdProvider repository)
Create SSH URL used for repository remote configs

Parameters:
repository -
Returns:
URL

createRemoteSshUrl

public static String createRemoteSshUrl(IRepositoryIdProvider repository,
                                        String host)
Create SSH URL used for repository remote configs

Parameters:
repository -
host -
Returns:
URL

createRemoteHttpsUrl

public static String createRemoteHttpsUrl(IRepositoryIdProvider repository,
                                          String user)
Create HTTPS URL used for repository remote configs

Parameters:
repository -
user -
Returns:
URL

createRemoteHttpsUrl

public static String createRemoteHttpsUrl(IRepositoryIdProvider repository,
                                          String host,
                                          String user)
Create HTTPS URL used for repository remote configs

Parameters:
repository -
host -
user -
Returns:
URL

createRemoteReadOnlyUrl

public static String createRemoteReadOnlyUrl(IRepositoryIdProvider repository)
Create read-only URL used for repository remote configs

Parameters:
repository -
Returns:
URL

createRemoteReadOnlyUrl

public static String createRemoteReadOnlyUrl(IRepositoryIdProvider repository,
                                             String host)
Create read-only URL used for repository remote configs

Parameters:
repository -
host -
Returns:
URL

encode

public static String encode(String value)
URL-encode value using 'ISO-8859-1' character set

Parameters:
value -
Returns:
encoded value

decode

public static String decode(String value)
URL-decode value using 'ISO-8859-1' character set

Parameters:
value -
Returns:
encoded value

addParam

public static void addParam(String name,
                            String value,
                            StringBuilder uri)
Add encoded parameter to URI

Parameters:
name -
value -
uri -

addParams

public static void addParams(Map<String,String> params,
                             StringBuilder uri)
Add request parameters to URI

Parameters:
params -
uri -

getParam

public static String getParam(URI uri,
                              String name)
Get parameter value with name

Parameters:
uri -
name -
Returns:
value or null if not found in URI query


Copyright © 2012. All Rights Reserved.