OSDN Git Service

* System.load() will still be called on natives even if the file already exists
authorshadowislord <shadowislord@75d07b2b-3a1a-0410-a2c5-0572b91ccdca>
Mon, 18 Jul 2011 16:27:32 +0000 (16:27 +0000)
committershadowislord <shadowislord@75d07b2b-3a1a-0410-a2c5-0572b91ccdca>
Mon, 18 Jul 2011 16:27:32 +0000 (16:27 +0000)
git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@7880 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

engine/src/desktop/com/jme3/system/Natives.java

index c79c456..b6e5094 100644 (file)
@@ -83,19 +83,21 @@ public class Natives {
         URLConnection conn = url.openConnection();
         InputStream in = conn.getInputStream();
         File targetFile = new File(workingDir, fullname);
-        if (targetFile.exists()){
-            // OK, compare last modified date of this file to 
-            // file in jar
-            long targetLastModified = targetFile.lastModified();
-            long sourceLastModified = conn.getLastModified();
-            
-            // Allow ~1 second range for OSes that only support low precision
-            if (targetLastModified + 1000 > sourceLastModified){
-                logger.log(Level.FINE, "Not copying library {0}. Latest already extracted.", fullname);
-                return;
-            }
-        }
+        
         try {
+            if (targetFile.exists()){
+                // OK, compare last modified date of this file to 
+                // file in jar
+                long targetLastModified = targetFile.lastModified();
+                long sourceLastModified = conn.getLastModified();
+
+                // Allow ~1 second range for OSes that only support low precision
+                if (targetLastModified + 1000 > sourceLastModified){
+                    logger.log(Level.FINE, "Not copying library {0}. Latest already extracted.", fullname);
+                    return;
+                }
+            }
+            
             OutputStream out = new FileOutputStream(targetFile);
             int len;
             while ((len = in.read(buf)) > 0) {