Skip to content

Commit

Permalink
swtiched to url.openConnection().getLastModified
Browse files Browse the repository at this point in the history
  • Loading branch information
richhickey committed Feb 28, 2009
1 parent 57859c0 commit 7059dd1
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/jvm/clojure/lang/RT.java
Expand Up @@ -337,18 +337,8 @@ static public void init() throws Exception{
((PrintWriter)RT.ERR.deref()).println("No need to call RT.init() anymore");
}

static public long lastModified(URL url,String libfile) throws Exception{
if(url.getProtocol().equals("jar"))
{
return ((JarURLConnection)url.openConnection()).getJarFile().getEntry(libfile).getTime();
}
else if(url.getProtocol().equals("file"))
{
File f = new File(url.toURI());
return f.lastModified();
}
else
return 0;
static public long lastModified(URL url) throws Exception{
return url.openConnection().getLastModified();
}

static void compile(String cljfile) throws Exception{
Expand Down Expand Up @@ -383,7 +373,7 @@ static public void load(String scriptbase, boolean failIfNotFound) throws Except

if((classURL != null &&
(cljURL == null
|| lastModified(classURL, classfile) > lastModified(cljURL, cljfile)))
|| lastModified(classURL) > lastModified(cljURL)))
|| classURL == null)
{
try
Expand Down

0 comments on commit 7059dd1

Please sign in to comment.