Modifier and Type | Method and Description |
---|---|
static URL |
appendTrailingSlash(URL originalURL)
Appends a trailing '/' to a
URL object. |
static long |
getLastModified(URL resourceURL)
Returns the last modified time for file:// and jar:// URLs.
|
static boolean |
isDirectory(URL resourceURL)
Returns true if the URL passed to it corresponds to a directory.
|
public static boolean isDirectory(URL resourceURL) throws URISyntaxException
JarFile
API. Only jar:// and file:// URLs are supported.resourceURL
- the URL to checkURISyntaxException
public static URL appendTrailingSlash(URL originalURL)
URL
object. Does not append a slash if one is already present.originalURL
- The URL to append a slash topublic static long getLastModified(URL resourceURL)
URLConnection
to a file opens an InputStream
to that file that
must then be closed — though this is not true for URLConnection
s to jar resources
2) calling getLastModified on JarURLConnection
s returns the last modified time of the jar file, rather
than the file withinresourceURL
- the URL to return the last modified time forCopyright © 2019. All rights reserved.