/[classpath]/classpath/gnu/java/net/protocol/jar/Connection.java
ViewVC logotype

Diff of /classpath/gnu/java/net/protocol/jar/Connection.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by mark, Sat Jul 2 20:32:13 2005 UTC revision 1.10 by tromey, Tue Sep 20 21:01:44 2005 UTC
# Line 69  public final class Connection extends Ja Line 69  public final class Connection extends Ja
69      private static Hashtable cache = new Hashtable();      private static Hashtable cache = new Hashtable();
70      private static final int READBUFSIZE = 4*1024;      private static final int READBUFSIZE = 4*1024;
71            
72      public static synchronized JarFile get (URL url) throws IOException      public static synchronized JarFile get (URL url, boolean useCaches)
73           throws IOException
74      {      {
75        JarFile jf = (JarFile) cache.get (url);        JarFile jf;
76          if (useCaches)
77            {
78              jf = (JarFile) cache.get (url);
79              if (jf != null)
80                return jf;
81            }
82    
       if (jf != null)  
         return jf;  
         
83        if ("file".equals (url.getProtocol()))        if ("file".equals (url.getProtocol()))
84          {          {
85            File f = new File (url.getFile());            File f = new File (url.getFile());
# Line 100  public final class Connection extends Ja Line 104  public final class Connection extends Ja
104            jf = new JarFile (f, true,            jf = new JarFile (f, true,
105                              ZipFile.OPEN_READ | ZipFile.OPEN_DELETE);                              ZipFile.OPEN_READ | ZipFile.OPEN_DELETE);
106          }          }
107              
108        cache.put (url, jf);        if (useCaches)
109                  cache.put (url, jf);
110    
111        return jf;        return jf;
112      }      }
113    }    }
# Line 120  public final class Connection extends Ja Line 125  public final class Connection extends Ja
125        return;        return;
126    
127      jar_url = getJarFileURL();      jar_url = getJarFileURL();
128      jar_file = JarFileCache.get (jar_url);      jar_file = JarFileCache.get (jar_url, useCaches);
129      String entry_name = getEntryName();      String entry_name = getEntryName();
130            
131      if (entry_name != null      if (entry_name != null

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26