Jason Carreira wrote:
Do you know if there's a way to tell if it's in a jar file?

Not reliably, AFAIK. While you could get the CodeSource for a Class, a file is a different matter.


My solution would be even simpler. If a file cannot be read or written, it should not be able to change, at least in the normal operation of the VM. Simply excluding such files from a reload check would achieve the desired result.

I have attached a small patch against the current oscore CVS to illustrate this.

-craig



-----Original Message-----
From: Hani Suleiman [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 09, 2004 12:40 PM
To: [EMAIL PROTECTED]
Subject: Re: [OS-webwork] XWork, Webwork and reloading xml



In this case I'd say xwork is broken. The solution is for it to not bother monitoring files that are in jars.


On Mar 9, 2004, at 11:53 AM, Craig Raw wrote:





------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork



Index: FileManager.java
===================================================================
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 FileManager.java
--- FileManager.java    22 May 2003 05:26:34 -0000      1.1.1.1
+++ FileManager.java    10 Mar 2004 07:23:16 -0000
@@ -20,6 +20,7 @@
 /**
  * FileManager
  * @author Jason Carreira
+ * @author Craig Raw
  * Created May 7, 2003 8:44:26 PM
  */
 public class FileManager {
@@ -51,6 +52,10 @@
             return true;
         }
 
+        if (revision.getLastModified() == 0) {
+            return false;
+        }
+
         return revision.getLastModified() < revision.getFile().lastModified();
     }
 
@@ -84,10 +89,8 @@
             long lastModified = 0;
 
             if (!file.exists() || !file.canRead()) {
-                file = null;
-            }
-
-            if (file != null) {
+                files.put(fileName, new FileRevision(file, 0));
+            } else {
                 lastModified = file.lastModified();
                 files.put(fileName, new FileRevision(file, lastModified));
             }

Reply via email to