Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mortbay.util
Class JarResource  view JarResource download JarResource.java

java.lang.Object
  extended byorg.mortbay.util.Resource
      extended byorg.mortbay.util.URLResource
          extended byorg.mortbay.util.JarResource
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
JarFileResource

public class JarResource
extends URLResource


Field Summary
protected  java.net.JarURLConnection _jarConnection
           
private static org.apache.commons.logging.Log log
           
 
Fields inherited from class org.mortbay.util.URLResource
_connection, _in, _url, _urlString
 
Fields inherited from class org.mortbay.util.Resource
_associate
 
Constructor Summary
(package private) JarResource(java.net.URL url)
           
 
Method Summary
protected  boolean checkConnection()
           
 boolean exists()
          Returns true if the respresenetd resource exists.
 void extract(java.io.File directory, boolean deleteOnExit)
           
static void extract(Resource resource, java.io.File directory, boolean deleteOnExit)
           
 java.io.File getFile()
          Returns an File representing the given resource or NULL if this is not possible.
 java.io.InputStream getInputStream()
          Returns an input stream to the resource
protected  void newConnection()
           
 void release()
          Release any resources held by the resource.
 
Methods inherited from class org.mortbay.util.URLResource
addPath, delete, equals, getName, getOutputStream, getURL, hashCode, isDirectory, lastModified, length, list, renameTo, toString
 
Methods inherited from class org.mortbay.util.Resource
cache, encode, finalize, getAlias, getAssociate, getListHTML, newResource, newResource, newSystemResource, setAssociate, writeTo
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

log

private static org.apache.commons.logging.Log log

_jarConnection

protected transient java.net.JarURLConnection _jarConnection
Constructor Detail

JarResource

JarResource(java.net.URL url)
Method Detail

release

public void release()
Description copied from class: URLResource
Release any resources held by the resource.

Overrides:
release in class URLResource

checkConnection

protected boolean checkConnection()
Overrides:
checkConnection in class URLResource

newConnection

protected void newConnection()
                      throws java.io.IOException

exists

public boolean exists()
Returns true if the respresenetd resource exists.

Overrides:
exists in class URLResource

getFile

public java.io.File getFile()
                     throws java.io.IOException
Description copied from class: URLResource
Returns an File representing the given resource or NULL if this is not possible.

Overrides:
getFile in class URLResource

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Description copied from class: URLResource
Returns an input stream to the resource

Overrides:
getInputStream in class URLResource

extract

public static void extract(Resource resource,
                           java.io.File directory,
                           boolean deleteOnExit)
                    throws java.io.IOException

extract

public void extract(java.io.File directory,
                    boolean deleteOnExit)
             throws java.io.IOException