Package snap.util
Class URLUtils
java.lang.Object
snap.util.URLUtils
Utilities for URL.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
Returns bytes for url.static File
Returns the URL as a file.static long
getLastModTime
(URL aURL) Returns the last modified time of a URL.static File
getLocalFile
(URL aURL) Returns the given URL as a file (downloading to temp dir, if necessary).static File
getLocalFile
(URL aURL, File aFile) Returns the given URL as given file by downloading it.static File
getLocalFileDestination
(URL aURL, File aFile) Returns the destination file that the given URL would be saved to using the getLocalFile method.static String
getRedirectString
(String aURLString) Returns a redirect string.static String
Returns the URL string for given object.static URI
Returns a URL for given string.static boolean
Returns whether a URL is local.static void
Tries to open the given URL with the platform reader.static void
Prime network connections: Java desktop seems to take a second+ to do first URL fetch.
-
Constructor Details
-
URLUtils
public URLUtils()
-
-
Method Details
-
getURI
Returns a URL for given string. -
getString
Returns the URL string for given object. -
getRedirectString
Returns a redirect string. -
openURL
Tries to open the given URL with the platform reader. -
getBytes
Returns bytes for url.- Throws:
IOException
-
getLastModTime
Returns the last modified time of a URL. -
isLocal
Returns whether a URL is local. -
getFile
Returns the URL as a file. -
getLocalFile
Returns the given URL as a file (downloading to temp dir, if necessary).- Throws:
IOException
-
getLocalFile
Returns the given URL as given file by downloading it.- Throws:
IOException
-
getLocalFileDestination
Returns the destination file that the given URL would be saved to using the getLocalFile method. -
primeNetworkConnection
public static void primeNetworkConnection()Prime network connections: Java desktop seems to take a second+ to do first URL fetch.
-