public class JarResource extends URLResource
Modifier and Type | Field and Description |
---|---|
protected JarURLConnection |
_jarConnection |
_connection, _in, _url, _urlString
__defaultUseCaches
Modifier | Constructor and Description |
---|---|
protected |
JarResource(URL url) |
protected |
JarResource(URL url,
boolean useCaches) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkConnection() |
void |
close()
Release any resources held by the resource.
|
void |
copyTo(File directory)
Copy the Resource to the new destination file.
|
boolean |
exists()
Returns true if the represented resource exists.
|
File |
getFile()
Returns an File representing the given resource or NULL if this
is not possible.
|
InputStream |
getInputStream()
Returns an input stream to the resource.
|
protected void |
newConnection() |
static Resource |
newJarResource(Resource resource) |
addPath, delete, equals, getInputStream, getName, getReadableByteChannel, getURL, getUseCaches, hashCode, isContainedIn, isDirectory, lastModified, length, list, renameTo, toString
encode, finalize, getAlias, getAllResources, getAssociate, getDefaultUseCaches, getListHTML, getResource, getURI, getWeakETag, getWeakETag, isAlias, isContainedIn, newClassPathResource, newClassPathResource, newResource, newResource, newResource, newResource, newResource, newSystemResource, release, setAssociate, setDefaultUseCaches, toURL, writeTo
protected JarURLConnection _jarConnection
protected JarResource(URL url)
protected JarResource(URL url, boolean useCaches)
public void close()
URLResource
close
in interface Closeable
close
in interface AutoCloseable
close
in class URLResource
protected boolean checkConnection()
checkConnection
in class URLResource
protected void newConnection() throws IOException
IOException
- Sub-classes of JarResource
may throw an IOException (or subclass)public boolean exists()
exists
in class URLResource
public File getFile() throws IOException
URLResource
getFile
in class URLResource
IOException
- if unable to get the resource due to permissionspublic InputStream getInputStream() throws IOException
URLResource
getInputStream
in class URLResource
IOException
- if unable to open the input streampublic void copyTo(File directory) throws IOException
Resource
Will not replace existing destination file.
copyTo
in class Resource
directory
- the destination file to createIOException
- if unable to copy the resourcepublic static Resource newJarResource(Resource resource) throws IOException
IOException
Copyright © 1995–2017 Webtide. All rights reserved.