// Path: compress/src/main/java/com/switchfly/compress/cli/configuration/IConfiguration.java
// public interface IConfiguration {
// 
//     void loadFile(String path) throws IOException;
// 
//     void loadDocument(String document);
// 
//     void loadStream(InputStream stream);
// 
//     Set<String> getJsPackages();
// 
//     Set<String> getCSSPackages();
// 
//     List<String> getFilesForJsPackage(String jsPackage);
// 
//     List<String> getFilesForCssPackage(String cssPackage);
// }
// 
// Path: compress/src/main/java/com/switchfly/compress/cli/configuration/YamlConfiguration.java
// public class YamlConfiguration implements IConfiguration {
// 
//     private Map<String, List<String>> _cssMap = new HashMap<String, List<String>>();
//     private Map<String, List<String>> _jsMap = new HashMap<String, List<String>>();
// 
//     @Override
//     public Set<String> getCSSPackages() {
//         return _cssMap.keySet();
//     }
// 
//     @Override
//     public List<String> getFilesForCssPackage(String cssPackage) {
//         if (_cssMap.containsKey(cssPackage)) {
//             return _cssMap.get(cssPackage);
//         }
//         return Collections.emptyList();
//     }
// 
//     @Override
//     public Set<String> getJsPackages() {
//         return _jsMap.keySet();
//     }
// 
//     @Override
//     public List<String> getFilesForJsPackage(String jsPackage) {
//         if (_jsMap.containsKey(jsPackage)) {
//             return _jsMap.get(jsPackage);
//         }
//         return Collections.emptyList();
//     }
// 
//     @Override
//     public void loadFile(String path) throws IOException {
//         InputStream input = null;
//         try {
//             input = new FileInputStream(new File(path));
//             loadStream(input);
//         } finally {
//             if (input != null) {
//                 input.close();
//             }
//         }
//     }
// 
//     @Override
//     public void loadDocument(String document) {
//         Yaml yaml = new Yaml();
//         processData(yaml.load(document));
//     }
// 
//     @Override
//     public void loadStream(InputStream stream) {
//         Yaml yaml = new Yaml();
//         processData(yaml.load(stream));
//     }
// 
//     private boolean isDocumentValid(Object document) {
//         if (!(document instanceof Map)) {
//             return false;
//         }
// 
//         //NOTE: we dont attempt to resolve element types. If file format is not as expected we let the app blow up
//         return true;
//     }
// 
//     @SuppressWarnings("unchecked")
//     private void processData(Object document) {
// 
//         if (!isDocumentValid(document)) {
//             return;
//         }
// 
//         Map<String, List<LinkedHashMap<String, Vector<String>>>> data = (Map<String, List<LinkedHashMap<String, Vector<String>>>>) document;
// 
//         if (data.containsKey("javascript")) {
//             populateFileMapFromStructure(_jsMap, data.get("javascript"), ".js");
//         }
// 
//         if (data.containsKey("stylesheet")) {
//             populateFileMapFromStructure(_cssMap, data.get("stylesheet"), ".css");
//         }
//     }
// 
//     private void populateFileMapFromStructure(Map<String, List<String>> map, List<LinkedHashMap<String, Vector<String>>> value,
//         String fileExtension) {
// 
//         for (LinkedHashMap<String, Vector<String>> fileSet : value) {
//             for (String key : fileSet.keySet()) {
//                 ArrayList<String> files = new ArrayList<String>();
//                 List<String> valueFiles = fileSet.get(key);
//                 for (String aFile : valueFiles) {
//                     files.add(aFile + fileExtension);
//                 }
//                 map.put(key, files);
//             }
//         }
//     }
// }
// 
// Path: compress/src/main/java/com/switchfly/compress/cli/exceptions/CompressorException.java
// @SuppressWarnings("serial")
// public class CompressorException extends Exception {
// 
//     public CompressorException(String message) {
//         super(message);
//     }
// }


import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.util.List;
import java.util.Set;
import com.switchfly.compress.cli.configuration.IConfiguration;
import com.switchfly.compress.cli.configuration.YamlConfiguration;
import com.switchfly.compress.cli.exceptions.CompressorException;
import com.yahoo.platform.yui.compressor.CssCompressor;
import com.yahoo.platform.yui.compressor.JavaScriptCompressor;
import jargs.gnu.CmdLineParser;
import org.mozilla.javascript.ErrorReporter;
import org.mozilla.javascript.EvaluatorException;

    public void setIsVerbose(boolean isVerbose) {
        this._isVerbose = isVerbose;
    }

    public void setIsDebug(boolean isDebug) {
        this._isDebug = isDebug;
    }

    public void setLineBreakPos(int breakPos) {
        _lineBreakPos = breakPos;
    }

    public void setObfuscate(boolean obfuscate) {
        _obfuscate = obfuscate;
    }

    public void setDisableMicroOptimizations(boolean disableMicroOptimizations) {
        _disableMicroOptimizations = disableMicroOptimizations;
    }

    public void setPreserveUnecessarySemicolons(boolean preserveUnecessarySemicolons) {
        _preserveUnecessarySemicolons = preserveUnecessarySemicolons;
    }

    public void setOutputPath(String outputPath) {
        _outputPath = outputPath;
    }

    public void setConfigurationFromFile(String configurationPath) throws CompressorException, IOException {
// Path: compress/src/main/java/com/switchfly/compress/cli/configuration/IConfiguration.java
// public interface IConfiguration {
// 
//     void loadFile(String path) throws IOException;
// 
//     void loadDocument(String document);
// 
//     void loadStream(InputStream stream);
// 
//     Set<String> getJsPackages();
// 
//     Set<String> getCSSPackages();
// 
//     List<String> getFilesForJsPackage(String jsPackage);
// 
//     List<String> getFilesForCssPackage(String cssPackage);
// }
// 
// Path: compress/src/main/java/com/switchfly/compress/cli/configuration/YamlConfiguration.java
// public class YamlConfiguration implements IConfiguration {
// 
//     private Map<String, List<String>> _cssMap = new HashMap<String, List<String>>();
//     private Map<String, List<String>> _jsMap = new HashMap<String, List<String>>();
// 
//     @Override
//     public Set<String> getCSSPackages() {
//         return _cssMap.keySet();
//     }
// 
//     @Override
//     public List<String> getFilesForCssPackage(String cssPackage) {
//         if (_cssMap.containsKey(cssPackage)) {
//             return _cssMap.get(cssPackage);
//         }
//         return Collections.emptyList();
//     }
// 
//     @Override
//     public Set<String> getJsPackages() {
//         return _jsMap.keySet();
//     }
// 
//     @Override
//     public List<String> getFilesForJsPackage(String jsPackage) {
//         if (_jsMap.containsKey(jsPackage)) {
//             return _jsMap.get(jsPackage);
//         }
//         return Collections.emptyList();
//     }
// 
//     @Override
//     public void loadFile(String path) throws IOException {
//         InputStream input = null;
//         try {
//             input = new FileInputStream(new File(path));
//             loadStream(input);
//         } finally {
//             if (input != null) {
//                 input.close();
//             }
//         }
//     }
// 
//     @Override
//     public void loadDocument(String document) {
//         Yaml yaml = new Yaml();
//         processData(yaml.load(document));
//     }
// 
//     @Override
//     public void loadStream(InputStream stream) {
//         Yaml yaml = new Yaml();
//         processData(yaml.load(stream));
//     }
// 
//     private boolean isDocumentValid(Object document) {
//         if (!(document instanceof Map)) {
//             return false;
//         }
// 
//         //NOTE: we dont attempt to resolve element types. If file format is not as expected we let the app blow up
//         return true;
//     }
// 
//     @SuppressWarnings("unchecked")
//     private void processData(Object document) {
// 
//         if (!isDocumentValid(document)) {
//             return;
//         }
// 
//         Map<String, List<LinkedHashMap<String, Vector<String>>>> data = (Map<String, List<LinkedHashMap<String, Vector<String>>>>) document;
// 
//         if (data.containsKey("javascript")) {
//             populateFileMapFromStructure(_jsMap, data.get("javascript"), ".js");
//         }
// 
//         if (data.containsKey("stylesheet")) {
//             populateFileMapFromStructure(_cssMap, data.get("stylesheet"), ".css");
//         }
//     }
// 
//     private void populateFileMapFromStructure(Map<String, List<String>> map, List<LinkedHashMap<String, Vector<String>>> value,
//         String fileExtension) {
// 
//         for (LinkedHashMap<String, Vector<String>> fileSet : value) {
//             for (String key : fileSet.keySet()) {
//                 ArrayList<String> files = new ArrayList<String>();
//                 List<String> valueFiles = fileSet.get(key);
//                 for (String aFile : valueFiles) {
//                     files.add(aFile + fileExtension);
//                 }
//                 map.put(key, files);
//             }
//         }
//     }
// }
// 
// Path: compress/src/main/java/com/switchfly/compress/cli/exceptions/CompressorException.java
// @SuppressWarnings("serial")
// public class CompressorException extends Exception {
// 
//     public CompressorException(String message) {
//         super(message);
//     }
// }


// Path: compress/src/main/java/com/switchfly/compress/cli/CompressCLI.java
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.util.List;
import java.util.Set;
import com.switchfly.compress.cli.configuration.IConfiguration;
import com.switchfly.compress.cli.configuration.YamlConfiguration;
import com.switchfly.compress.cli.exceptions.CompressorException;
import com.yahoo.platform.yui.compressor.CssCompressor;
import com.yahoo.platform.yui.compressor.JavaScriptCompressor;
import jargs.gnu.CmdLineParser;
import org.mozilla.javascript.ErrorReporter;
import org.mozilla.javascript.EvaluatorException;


    public void setIsVerbose(boolean isVerbose) {
        this._isVerbose = isVerbose;
    }

    public void setIsDebug(boolean isDebug) {
        this._isDebug = isDebug;
    }

    public void setLineBreakPos(int breakPos) {
        _lineBreakPos = breakPos;
    }

    public void setObfuscate(boolean obfuscate) {
        _obfuscate = obfuscate;
    }

    public void setDisableMicroOptimizations(boolean disableMicroOptimizations) {
        _disableMicroOptimizations = disableMicroOptimizations;
    }

    public void setPreserveUnecessarySemicolons(boolean preserveUnecessarySemicolons) {
        _preserveUnecessarySemicolons = preserveUnecessarySemicolons;
    }

    public void setOutputPath(String outputPath) {
        _outputPath = outputPath;
    }

    public void setConfigurationFromFile(String configurationPath) throws CompressorException, IOException {
        _config = new YamlConfiguration();