|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gudy.azureus2.core3.util.UrlUtils
public class UrlUtils
Constructor Summary | |
---|---|
UrlUtils()
|
Method Summary | |
---|---|
static Socket |
connectSocketAndWrite(boolean is_ssl,
String target_host,
int target_port,
byte[] bytes,
int connect_timeout,
int read_timeout)
|
static Socket |
connectSocketAndWrite(boolean is_ssl,
String target_host,
int target_port,
byte[] bytes,
int connect_timeout,
int read_timeout,
boolean unconnected_socket_hack)
|
static void |
connectWithTimeout(URLConnection connection,
long connect_timeout)
|
static void |
connectWithTimeouts(URLConnection connection,
long connect_timeout,
long read_timeout)
|
static boolean |
containsPasskey(URL url)
|
static String |
convertIPV6Host(String host)
|
static String |
decode(String s)
|
static Map<String,String> |
decodeArgs(String args)
|
static String |
decodeIfNeeded(String s)
Unfortunately we have code that mindlessly decoded URLs (FileDownloadWindow) which borked (in the case I discovered) magnet uris with encoded parameters (e.g. |
static byte[] |
decodeSHA1Hash(String str)
|
static void |
DHHackIt(HttpsURLConnection ssl_con)
|
static SSLSocketFactory |
DHHackIt(SSLSocketFactory factory)
|
static String |
encode(String s)
Like URLEncoder.encode, except translates spaces into %20 instead of + |
static String |
escapeXML(String s)
|
static String |
expandIPV6Host(String host)
|
static byte[] |
extractHash(String magnet_uri)
|
static Set<String> |
extractNetworks(String[] magnet_uri)
|
static URL |
getBaseURL(URL u)
|
static Map |
getBrowserHeaders(String referer)
|
static String |
getCanonicalString(URL url)
|
static long |
getContentLength(URLConnection con)
|
static byte[] |
getHashFromMagnetURI(String magnetURI)
|
static URL |
getIPV4Fallback(URL url)
Returns an explicit IPv4 url if the supplied one has both IPv6 and IPv4 addresses |
static String |
getMagnetURI(byte[] hash)
|
static String |
getMagnetURI(byte[] hash,
String name,
String[] networks)
|
static String |
getMagnetURI(Download download)
|
static String |
getMagnetURI(Download download,
int max_name_len)
|
static String |
getMagnetURI(DownloadManager dm)
|
static String |
getMagnetURI(DownloadManager dm,
int max_name_len)
|
static String |
getMagnetURI(String name,
Torrent torrent)
|
static String |
getURL(String text)
|
static void |
HTTPSURLConnectionSNIHack(String host_name,
HttpsURLConnection con)
|
static boolean |
isInternalProtocol(String url)
|
static boolean |
isURL(String sURL)
test string for possibility that it's an URL. |
static boolean |
isURL(String sURL,
boolean bGuess)
|
static void |
main(String[] args)
|
static String |
normaliseMagnetURI(String base_hash)
returns magnet uri if input is base 32 or base 16 encoded sha1 hash, null otherwise |
static String |
parseTextForMagnets(String text)
|
static String |
parseTextForURL(String text,
boolean accept_magnets)
|
static String |
parseTextForURL(String text,
boolean accept_magnets,
boolean guess)
|
static boolean |
queryHasParameter(String query_string,
String param_name,
boolean case_sensitive)
|
static void |
setBrowserHeaders(ResourceDownloader rd,
String referer)
|
static void |
setBrowserHeaders(ResourceDownloader rd,
String encoded_headers,
String referer)
|
static void |
setBrowserHeaders(ResourceUploader ru,
String encoded_headers,
String referer)
|
static void |
setBrowserHeaders(URLConnection connection,
String referer)
|
static void |
setBrowserHeaders(URLConnection connection,
String encoded_headers,
String referer)
|
static URL |
setHost(URL u,
String host)
|
static URL |
setPort(URL u,
int port)
|
static URL |
setProtocol(URL u,
String protocol)
|
static boolean |
SSLSocketSNIHack(String host_name,
SSLSocket socket)
|
static String |
unescapeXML(String s)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UrlUtils()
Method Detail |
---|
public static Map<String,String> decodeArgs(String args)
public static String getMagnetURI(byte[] hash)
public static String getMagnetURI(byte[] hash, String name, String[] networks)
public static byte[] extractHash(String magnet_uri)
public static Set<String> extractNetworks(String[] magnet_uri)
public static String getMagnetURI(Download download)
public static String getMagnetURI(Download download, int max_name_len)
public static String getMagnetURI(DownloadManager dm)
public static String getMagnetURI(DownloadManager dm, int max_name_len)
public static String getMagnetURI(String name, Torrent torrent)
public static String normaliseMagnetURI(String base_hash)
base_hash
-
public static byte[] getHashFromMagnetURI(String magnetURI)
public static byte[] decodeSHA1Hash(String str)
public static boolean isURL(String sURL)
sURL
-
public static boolean isURL(String sURL, boolean bGuess)
public static String parseTextForURL(String text, boolean accept_magnets)
public static String getURL(String text)
public static boolean isInternalProtocol(String url)
public static String parseTextForURL(String text, boolean accept_magnets, boolean guess)
public static String parseTextForMagnets(String text)
public static String encode(String s)
s
-
public static String decode(String s)
public static String decodeIfNeeded(String s)
s
-
public static String escapeXML(String s)
public static String unescapeXML(String s)
public static String convertIPV6Host(String host)
public static String expandIPV6Host(String host)
public static void connectWithTimeout(URLConnection connection, long connect_timeout) throws IOException
IOException
public static void connectWithTimeouts(URLConnection connection, long connect_timeout, long read_timeout) throws IOException
IOException
public static void setBrowserHeaders(ResourceDownloader rd, String referer)
public static void setBrowserHeaders(ResourceDownloader rd, String encoded_headers, String referer)
public static void setBrowserHeaders(ResourceUploader ru, String encoded_headers, String referer)
public static void setBrowserHeaders(URLConnection connection, String referer)
public static void setBrowserHeaders(URLConnection connection, String encoded_headers, String referer)
public static Map getBrowserHeaders(String referer)
public static boolean queryHasParameter(String query_string, String param_name, boolean case_sensitive)
public static boolean containsPasskey(URL url)
public static URL setPort(URL u, int port)
public static URL setHost(URL u, String host)
public static URL setProtocol(URL u, String protocol)
public static URL getBaseURL(URL u)
public static String getCanonicalString(URL url)
public static URL getIPV4Fallback(URL url)
url
-
public static long getContentLength(URLConnection con)
public static boolean SSLSocketSNIHack(String host_name, SSLSocket socket)
public static SSLSocketFactory DHHackIt(SSLSocketFactory factory)
public static void HTTPSURLConnectionSNIHack(String host_name, HttpsURLConnection con)
public static void DHHackIt(HttpsURLConnection ssl_con)
public static Socket connectSocketAndWrite(boolean is_ssl, String target_host, int target_port, byte[] bytes, int connect_timeout, int read_timeout) throws Exception
Exception
public static Socket connectSocketAndWrite(boolean is_ssl, String target_host, int target_port, byte[] bytes, int connect_timeout, int read_timeout, boolean unconnected_socket_hack) throws Exception
Exception
public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |