// Path: appassembler-maven-plugin/src/main/java/org/codehaus/mojo/appassembler/daemon/DaemonGeneratorException.java
// public class DaemonGeneratorException
//     extends Exception
// {
//     /**
//      *
//      */
//     private static final long serialVersionUID = 6989317744526360832L;
// 
//     /**
//      * Exception with message.
//      *
//      * @param message The message for the execption.
//      */
//     public DaemonGeneratorException( String message )
//     {
//         super( message );
//     }
// 
//     /**
//      * The exception with an appropriate message and the cause of the failure.
//      *
//      * @param message The message to show.
//      * @param cause The root cause.
//      */
//     public DaemonGeneratorException( String message, Throwable cause )
//     {
//         super( message, cause );
//     }
// }


import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.codehaus.mojo.appassembler.daemon.DaemonGeneratorException;
import org.codehaus.mojo.appassembler.model.ClasspathElement;
import org.codehaus.mojo.appassembler.model.Daemon;
import org.codehaus.mojo.appassembler.model.Dependency;
import org.codehaus.mojo.appassembler.model.Directory;
import org.codehaus.mojo.appassembler.model.JvmSettings;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.InterpolationFilterReader;
import org.codehaus.plexus.util.StringUtils;
package org.codehaus.mojo.appassembler.daemon.script;

/*
 * The MIT License
 *
 * Copyright (c) 2006-2012, The Codehaus
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of
 * this software and associated documentation files (the "Software"), to deal in
 * the Software without restriction, including without limitation the rights to
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
 * of the Software, and to permit persons to whom the Software is furnished to do
 * so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */



/**
 * @author <a href="mailto:trygve.laugstol@objectware.no">Trygve Laugst&oslash;l</a>
 */
public class Platform
{
    /**
     * Unix as Platform name.
     */
    public static final String UNIX_NAME = "unix";

    /**
     * Windows Platform name.
     */
    public static final String WINDOWS_NAME = "windows";

    private static final Map<String, Platform> ALL_PLATFORMS;

    private static final String DEFAULT_UNIX_BIN_FILE_EXTENSION = "";

    private static final String DEFAULT_WINDOWS_BIN_FILE_EXTENSION = ".bat";

    private String binFileExtension;

    private String name;

    private boolean isWindows;

    // -----------------------------------------------------------------------
    // Static
    // -----------------------------------------------------------------------

    static
    {
        ALL_PLATFORMS = new HashMap<String, Platform>();
        addPlatform( new Platform( UNIX_NAME, false, DEFAULT_UNIX_BIN_FILE_EXTENSION ) );
        addPlatform( new Platform( WINDOWS_NAME, true, DEFAULT_WINDOWS_BIN_FILE_EXTENSION ) );
    }

    private static Platform addPlatform( Platform platform )
    {
        ALL_PLATFORMS.put( platform.name, platform );

        return platform;
    }

    /**
     * Get an instance of the named platform.
     *
     * @param platformName The name of the wished platform.
     * @return Instance of the platform.
     * @throws DaemonGeneratorException in case of an wrong platformname.
     */
    public static Platform getInstance( String platformName )
// Path: appassembler-maven-plugin/src/main/java/org/codehaus/mojo/appassembler/daemon/DaemonGeneratorException.java
// public class DaemonGeneratorException
//     extends Exception
// {
//     /**
//      *
//      */
//     private static final long serialVersionUID = 6989317744526360832L;
// 
//     /**
//      * Exception with message.
//      *
//      * @param message The message for the execption.
//      */
//     public DaemonGeneratorException( String message )
//     {
//         super( message );
//     }
// 
//     /**
//      * The exception with an appropriate message and the cause of the failure.
//      *
//      * @param message The message to show.
//      * @param cause The root cause.
//      */
//     public DaemonGeneratorException( String message, Throwable cause )
//     {
//         super( message, cause );
//     }
// }


// Path: appassembler-maven-plugin/src/main/java/org/codehaus/mojo/appassembler/daemon/script/Platform.java
import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.codehaus.mojo.appassembler.daemon.DaemonGeneratorException;
import org.codehaus.mojo.appassembler.model.ClasspathElement;
import org.codehaus.mojo.appassembler.model.Daemon;
import org.codehaus.mojo.appassembler.model.Dependency;
import org.codehaus.mojo.appassembler.model.Directory;
import org.codehaus.mojo.appassembler.model.JvmSettings;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.InterpolationFilterReader;
import org.codehaus.plexus.util.StringUtils;

package org.codehaus.mojo.appassembler.daemon.script;

/*
 * The MIT License
 *
 * Copyright (c) 2006-2012, The Codehaus
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of
 * this software and associated documentation files (the "Software"), to deal in
 * the Software without restriction, including without limitation the rights to
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
 * of the Software, and to permit persons to whom the Software is furnished to do
 * so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */



/**
 * @author <a href="mailto:trygve.laugstol@objectware.no">Trygve Laugst&oslash;l</a>
 */
public class Platform
{
    /**
     * Unix as Platform name.
     */
    public static final String UNIX_NAME = "unix";

    /**
     * Windows Platform name.
     */
    public static final String WINDOWS_NAME = "windows";

    private static final Map<String, Platform> ALL_PLATFORMS;

    private static final String DEFAULT_UNIX_BIN_FILE_EXTENSION = "";

    private static final String DEFAULT_WINDOWS_BIN_FILE_EXTENSION = ".bat";

    private String binFileExtension;

    private String name;

    private boolean isWindows;

    // -----------------------------------------------------------------------
    // Static
    // -----------------------------------------------------------------------

    static
    {
        ALL_PLATFORMS = new HashMap<String, Platform>();
        addPlatform( new Platform( UNIX_NAME, false, DEFAULT_UNIX_BIN_FILE_EXTENSION ) );
        addPlatform( new Platform( WINDOWS_NAME, true, DEFAULT_WINDOWS_BIN_FILE_EXTENSION ) );
    }

    private static Platform addPlatform( Platform platform )
    {
        ALL_PLATFORMS.put( platform.name, platform );

        return platform;
    }

    /**
     * Get an instance of the named platform.
     *
     * @param platformName The name of the wished platform.
     * @return Instance of the platform.
     * @throws DaemonGeneratorException in case of an wrong platformname.
     */
    public static Platform getInstance( String platformName )
        throws DaemonGeneratorException