Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/metadata/METSFile.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/metadata/METSFile.java	(revision 7306)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/metadata/METSFile.java	(revision 7465)
@@ -139,5 +139,5 @@
   { String mimeType;
   
-    if (url.toString().startsWith("file://"))
+    if (url.getProtocol().equals("file"))
     { // TODO: Work out the MIME type
       mimeType = URLConnection.getFileNameMap().getContentTypeFor(url.toString().substring(7));
@@ -288,8 +288,17 @@
   }
 
+  /**
+   *  Get the location of this file as a URL
+   */
   public URL getURL()
   { return this.location.getLocation();
   }
 
+  /**
+   * 
+   */
+  public long getModifiedDatestamp()
+  { return this.location.getModifiedDatestamp();
+  }
 
   /**
Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/metadata/METSFileGroup.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/metadata/METSFileGroup.java	(revision 7306)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/metadata/METSFileGroup.java	(revision 7465)
@@ -37,4 +37,34 @@
   }
 
+  /**
+   *  Get the modified datestamp that applies for this file group.  An empty group
+   *  will return <code>0</code>.
+   *
+   *  @return <code>long</code> the date modified as milliseconds from the 1st January 1970
+   */
+  public long getModifiedDatestamp()
+  { long reply = 0; // empty groups reply '0'
+
+    Iterator childIter = children.iterator();
+    while (childIter.hasNext())
+    { METSFile file = (METSFile) childIter.next();
+      long fileStamp = file.getModifiedDatestamp();
+      if (fileStamp > reply) {
+	reply = fileStamp;
+      }
+    }
+
+    childIter = childGroups.iterator();
+    while (childIter.hasNext())
+    { METSFileGroup fileGroup = (METSFileGroup) childIter.next();
+      long fileStamp = fileGroup.getModifiedDatestamp();
+      if (fileStamp > reply) {
+	reply = fileStamp;
+      }
+    }
+
+    return reply;
+  }
+    
   /**
    *  Find all the occurrences of a given file, and place them
Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/metadata/METSFilePos.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/metadata/METSFilePos.java	(revision 7306)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/metadata/METSFilePos.java	(revision 7465)
@@ -28,4 +28,8 @@
   }
 
+  public long getModifiedDatestamp()
+  { return this.location.getModifiedDatestamp();
+  }
+
   public String toString()
   { return this.location.getLocation().toString();
Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/metadata/METSFileSet.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/metadata/METSFileSet.java	(revision 7306)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/metadata/METSFileSet.java	(revision 7465)
@@ -47,4 +47,21 @@
   }
 
+  public long getModifiedDatestamp()
+  { long reply = 0;
+
+    Iterator groupsIter = this.fileGroups.values().iterator();
+    while (groupsIter.hasNext())
+    { METSFileGroup group = (METSFileGroup) groupsIter.next();
+
+      long groupStamp = group.getModifiedDatestamp();
+      if (groupStamp > reply)
+      { reply = groupStamp;
+      }
+    }
+
+    return reply;
+  }
+    
+
   /**
    *  Get a new FileGroup to lie within this fileset.  The group is not initialised with
@@ -92,4 +109,7 @@
   }
 
+  /**
+   *  Add a file to the default file group
+   */
   public void addFile(METSFile file)
   { METSFileGroup defaultGroup = (METSFileGroup) this.fileGroups.get("default");
@@ -97,4 +117,10 @@
   }
 
+  /**
+   *  Add a file to the default file group
+   *
+   *  @return <code>METSFile</code> an object that wraps the given url into
+   *          a METS file object
+   */
   public METSFile addFile(URL url)
   { METSFile file = METSFile.makeMETSFile(url);
Index: trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/metadata/METSLocation.java
===================================================================
--- trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/metadata/METSLocation.java	(revision 7306)
+++ trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/metadata/METSLocation.java	(revision 7465)
@@ -3,4 +3,7 @@
 import java.io.File;
 import java.net.URL;
+import java.net.URLConnection;
+
+import org.greenstone.gsdl3.gs3build.util.URLTools;
 
 public class METSLocation
@@ -19,7 +22,7 @@
   }
 
-  public METSLocation(File file) throws java.net.MalformedURLException
+  public METSLocation(File file)
   { this.type = "URL";
-    this.location = new URL("file://" + file.toString());
+    this.location = URLTools.getFileURL(file);
   }
 
@@ -32,4 +35,23 @@
   }
 
+  public long getModifiedDatestamp()
+  { if (this.location != null) {
+      if (this.location.getProtocol().equals("file")) {
+	File file = new File(this.location.getPath());
+	return file.lastModified();
+      }
+      else {
+	try {
+	  URLConnection connection = this.location.openConnection();
+	  return connection.getLastModified();
+	}
+	catch (java.io.IOException io)
+	{ // TODO: report error
+	}
+      }
+    }
+    return System.currentTimeMillis();
+  }
+
   public String getType()
   { return this.type;
