Initial revision
[mir.git] / source / mir / misc / Helper.java
diff --git a/source/mir/misc/Helper.java b/source/mir/misc/Helper.java
new file mode 100755 (executable)
index 0000000..bbfb842
--- /dev/null
@@ -0,0 +1,35 @@
+package mir.misc;
+
+import java.io.IOException;
+
+/**
+ * Title:        Indy
+ * Description:  This class provides some satic help methods
+ * Copyright:    Copyright (c) 2001
+ * Company:      indymedia.de
+ * @author idfx
+ * @version 1.0
+ */
+
+public class Helper {
+
+  /**
+   * rsync the webrepository
+   * needs a rsyncscript
+   * returns the exit-code
+   */
+  public static int rsync(){
+    Process p;
+    int returnValue = -1;
+    try {
+      Runtime run = Runtime.getRuntime();
+      p = run.exec(Configuration.getProperty("Sync.Script.Path"));
+      returnValue = p.waitFor();
+    } catch (IOException e) {
+      return returnValue;
+    } catch (InterruptedException e) {
+      return returnValue;
+    }
+    return returnValue;
+  }
+}
\ No newline at end of file