public class JarFileResource extends JarResource
_jarConnection_connection, _in, _url, _urlString__defaultUseCaches| Modifier | Constructor and Description |
|---|---|
protected |
JarFileResource(URL url) |
protected |
JarFileResource(URL url,
boolean useCaches) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkConnection() |
void |
close()
Release any resources held by the resource.
|
boolean |
exists()
Returns true if the represented resource exists.
|
static Resource |
getNonCachingResource(Resource resource)
Take a Resource that possibly might use URLConnection caching
and turn it into one that doesn't.
|
boolean |
isContainedIn(Resource resource)
Check if this jar:file: resource is contained in the
named resource.
|
boolean |
isDirectory()
Returns true if the represented resource is a container/directory.
|
long |
lastModified()
Returns the last modified time
|
long |
length()
Return the length of the resource
|
String[] |
list()
Returns a list of resource names contained in the given resource
|
protected void |
newConnection() |
copyTo, getFile, getInputStream, newJarResourceaddPath, delete, equals, getInputStream, getName, getReadableByteChannel, getURL, getUseCaches, hashCode, renameTo, toStringencode, finalize, getAlias, getAllResources, getAssociate, getDefaultUseCaches, getListHTML, getResource, getURI, getWeakETag, getWeakETag, isAlias, isContainedIn, newClassPathResource, newClassPathResource, newResource, newResource, newResource, newResource, newResource, newResource, newSystemResource, release, setAssociate, setDefaultUseCaches, toURL, writeToprotected JarFileResource(URL url)
protected JarFileResource(URL url, boolean useCaches)
public void close()
URLResourceclose in interface Closeableclose in interface AutoCloseableclose in class JarResourceprotected boolean checkConnection()
checkConnection in class JarResourceprotected void newConnection()
throws IOException
newConnection in class JarResourceIOException - Sub-classes of JarResource may throw an IOException (or subclass)public boolean exists()
exists in class JarResourcepublic boolean isDirectory()
isDirectory in class URLResourcepublic long lastModified()
lastModified in class URLResourcepublic String[] list()
URLResourcelist in class URLResourcepublic long length()
length in class URLResourcepublic static Resource getNonCachingResource(Resource resource)
resource - the JarFileResource to obtain without URLConnection caching.public boolean isContainedIn(Resource resource) throws MalformedURLException
jar:file:///a/b/c/foo.jar!/x.html isContainedIn file:///a/b/c/foo.jarisContainedIn in class URLResourceresource - the resource to test forMalformedURLException - if unable to process is contained due to invalid URL formatCopyright © 1995–2018 Webtide. All rights reserved.