Package gov.nasa.arc.pds.tools.util
Class URLUtils
- java.lang.Object
-
- gov.nasa.arc.pds.tools.util.URLUtils
-
public class URLUtils extends Object
This class provides utilities for URL manipulation.- Author:
- jagander
-
-
Field Summary
Fields Modifier and Type Field Description static List<String>
TEXT_CONTENT_TYPES
-
Constructor Summary
Constructors Constructor Description URLUtils()
-
Method Summary
-
-
-
Method Detail
-
exists
public static boolean exists(URI uri)
-
exists
public static boolean exists(URL url)
-
getContent
public static URLContentsContainer getContent(URL url, long maxLength) throws IOException
- Throws:
IOException
-
getContent
public static URLContentsContainer getContent(URL url) throws IOException
- Throws:
IOException
-
getContentType
public static String getContentType(URL url) throws IOException
- Throws:
IOException
-
getContentType
public static String getContentType(URLConnection connection, URL url, InputStream is)
-
getCharset
public static String getCharset(URLConnection connection, String defaultCharset)
-
getContentLength
public static int getContentLength(URL url)
-
newURL
public static URL newURL(URL base, String filename) throws MalformedURLException
- Throws:
MalformedURLException
-
-