// Path: java/src/org/drupal/project/computing/exception/DRuntimeException.java
// public class DRuntimeException extends RuntimeException {
// 
//     public DRuntimeException() {
//         super();
//     }
// 
//     public DRuntimeException(String s) {
//         super(s);
//     }
// 
//     public DRuntimeException(String s, Throwable throwable) {
//         super(s, throwable);
//     }
// 
//     public DRuntimeException(Throwable throwable) {
//         super(throwable);
//     }
// }
// 
// Path: java/src/org/drupal/project/computing/exception/DSystemExecutionException.java
// public class DSystemExecutionException extends Exception {
//     public DSystemExecutionException() {
//     }
// 
//     public DSystemExecutionException(String s) {
//         super(s);
//     }
// 
//     public DSystemExecutionException(String s, Throwable throwable) {
//         super(s, throwable);
//     }
// 
//     public DSystemExecutionException(Throwable throwable) {
//         super(throwable);
//     }
// }


import com.google.gson.*;
import org.apache.commons.exec.CommandLine;
import org.apache.commons.exec.DefaultExecutor;
import org.apache.commons.exec.ExecuteWatchdog;
import org.apache.commons.exec.PumpStreamHandler;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.JavaVersion;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.SystemUtils;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.drupal.project.computing.exception.DRuntimeException;
import org.drupal.project.computing.exception.DSystemExecutionException;
import javax.script.Bindings;
import javax.script.SimpleBindings;
import java.io.*;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.util.*;
import java.util.logging.Logger;
     *
     * @param value the value, could be '1' or "true", or null.
     * @return
     */
    public boolean getBoolean(Object value) {
        if (value == null) {
            return false;
        } else if (value instanceof Boolean) {
            return (Boolean) value;
        } else if (value instanceof Integer) {
            return BooleanUtils.toBoolean((Integer) value);
        } else if (value instanceof String) {
            String str = (String) value;
            if (StringUtils.isBlank(str)) return false;
            try {
                int i = Integer.parseInt(str);
                return BooleanUtils.toBoolean(i);
            } catch (NumberFormatException e) {
                return BooleanUtils.toBoolean(str);
            }
        } else {
            throw new IllegalArgumentException("Cannot parse value: " + value.toString());
        }
    }



    public Properties loadProperties(String configString) {
        Properties config = new Properties();
        try {
// Path: java/src/org/drupal/project/computing/exception/DRuntimeException.java
// public class DRuntimeException extends RuntimeException {
// 
//     public DRuntimeException() {
//         super();
//     }
// 
//     public DRuntimeException(String s) {
//         super(s);
//     }
// 
//     public DRuntimeException(String s, Throwable throwable) {
//         super(s, throwable);
//     }
// 
//     public DRuntimeException(Throwable throwable) {
//         super(throwable);
//     }
// }
// 
// Path: java/src/org/drupal/project/computing/exception/DSystemExecutionException.java
// public class DSystemExecutionException extends Exception {
//     public DSystemExecutionException() {
//     }
// 
//     public DSystemExecutionException(String s) {
//         super(s);
//     }
// 
//     public DSystemExecutionException(String s, Throwable throwable) {
//         super(s, throwable);
//     }
// 
//     public DSystemExecutionException(Throwable throwable) {
//         super(throwable);
//     }
// }


// Path: java/src/org/drupal/project/computing/DUtils.java
import com.google.gson.*;
import org.apache.commons.exec.CommandLine;
import org.apache.commons.exec.DefaultExecutor;
import org.apache.commons.exec.ExecuteWatchdog;
import org.apache.commons.exec.PumpStreamHandler;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.JavaVersion;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.SystemUtils;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.drupal.project.computing.exception.DRuntimeException;
import org.drupal.project.computing.exception.DSystemExecutionException;
import javax.script.Bindings;
import javax.script.SimpleBindings;
import java.io.*;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.util.*;
import java.util.logging.Logger;

     *
     * @param value the value, could be '1' or "true", or null.
     * @return
     */
    public boolean getBoolean(Object value) {
        if (value == null) {
            return false;
        } else if (value instanceof Boolean) {
            return (Boolean) value;
        } else if (value instanceof Integer) {
            return BooleanUtils.toBoolean((Integer) value);
        } else if (value instanceof String) {
            String str = (String) value;
            if (StringUtils.isBlank(str)) return false;
            try {
                int i = Integer.parseInt(str);
                return BooleanUtils.toBoolean(i);
            } catch (NumberFormatException e) {
                return BooleanUtils.toBoolean(str);
            }
        } else {
            throw new IllegalArgumentException("Cannot parse value: " + value.toString());
        }
    }



    public Properties loadProperties(String configString) {
        Properties config = new Properties();
        try {
            config.load(new StringReader(configString));