]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/deploy/VersionedDirSync.java
IMmprove documentation
[gpl/argeo-slc.git] / runtime / org.argeo.slc.core / src / main / java / org / argeo / slc / core / deploy / VersionedDirSync.java
index 7199b0ef3fa3dbc29ab226cce4441602b967da0d..2c385cd354eda5a1c2b36e755fdfe71985d0362e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
+ * Copyright (C) 2007-2012 Mathieu Baudier
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.argeo.slc.core.deploy;
 
 import java.io.File;
@@ -37,9 +36,13 @@ public class VersionedDirSync implements Runnable {
        private String url;
        private Boolean clean = false;
 
+       private Boolean changed = null;
+
        public void run() {
+               changed = null;
                if (clean) {
                        try {
+                               log.info("Clean " + dir);
                                FileUtils.deleteDirectory(dir);
                        } catch (IOException e) {
                                throw new SlcException("Cannot delete checkout directory "
@@ -47,7 +50,8 @@ public class VersionedDirSync implements Runnable {
                        }
                        dir.mkdirs();
                }
-               versioningDriver.checkout(url, dir, true);
+               log.info("Checkout " + url + " to " + dir);
+               changed = versioningDriver.checkout(url, dir, true);
                if (log.isDebugEnabled())
                        log.debug("Synchronized " + url + " to " + dir);
        }
@@ -69,4 +73,11 @@ public class VersionedDirSync implements Runnable {
                this.clean = clean;
        }
 
+       /** Whether last call has changed the directory */
+       public Boolean getChanged() {
+               if (changed == null)
+                       throw new SlcException("Sync has not run");
+               return changed;
+       }
+
 }