public class HttpUtils extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
checkForRedirection(URL beforeConnUrl,
URL afterConnUrl) |
static HttpURLConnection |
connect(URL url) |
static List<HttpFile> |
findLinks(HttpFile file) |
static boolean |
isDirectory(URL url,
String virtualPath) |
static String |
readUrl(HttpURLConnection conn) |
static URI |
resolveUri(URI base,
String path)
|
public static URI resolveUri(URI base, String path) throws URISyntaxException
URI
and creates the resolved URI
.
(i.e. base = "http://localhost" ; path = "/path/to/file" ; resolved = "http://localhost/path/to/file")
Handles all cases: if base already has a path, if path is relative, if path is absolute.base
- The base URI
which the given path will be resolved against.path
- The path to be resolved against the given URI
URI
.URISyntaxException
public static HttpURLConnection connect(URL url) throws IOException
IOException
public static String readUrl(HttpURLConnection conn) throws IOException
IOException
public static List<HttpFile> findLinks(HttpFile file) throws IOException, URISyntaxException
IOException
URISyntaxException
public static boolean isDirectory(URL url, String virtualPath) throws IOException
IOException
Copyright © 1999-2015 Apache OODT. All Rights Reserved.