themeinstaller/source/src/com/nokia/tools/themeinstaller/installationmanager/InstallationParameters.java
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:32:13 +0100
branchRCL_3
changeset 18 04b7640f6fb5
parent 0 05da4621cfb2
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201032 Kit: 201035

/*
* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Installation parameters for starting the Installation Manager
 *
*/


package com.nokia.tools.themeinstaller.installationmanager;

import java.io.File;

/**
 * Installation parameters for starting the Installation Manager.
 */
public class InstallationParameters
    {

    // Manifest file
    private File iManifest;

    // Destination directory
    private File iDestinationDir;

    // Localisation settings
    private File iLocSettings;

    // External properties file
    private File iPropFile;

    /**
     * Constructor.
     * @param aManifest Manifest file
     * @param aDestinationDir Destination directory
     */
    public InstallationParameters( File aManifest, File aDestinationDir )
        {
        iManifest = aManifest;
        iDestinationDir = aDestinationDir;

        // Verify that theme manifest exists
        if( !aManifest.exists() )
            {
            throw new IllegalArgumentException(
                    "Manifest file not found: " + aManifest.getPath() );
            }

        // Verify that destination directory is not an existing file
        if( aDestinationDir.isFile() )
            {
            throw new IllegalArgumentException( "Invalid destination directory: " +
            		aDestinationDir.getPath() );
            }
        }

    /**
     * Get the manifest file.
     * @return the manifest file
     */
    public File getManifest()
        {
        return iManifest;
        }

    /**
     * Get the destination directory.
     * @return the destination directory
     */
    public File getDestinationDir()
        {
        return iDestinationDir;
        }

    /**
     * Get the localisation settings file.
     * @return the localisation settings file
     */
    public File getLocSettings()
        {
        return iLocSettings;
        }

    /**
     * Get the properties file.
     * @return the properties file
     */
    public File getPropFile()
        {
        return iPropFile;
        }

    /**
     * Set the localisation settings file.
     * @param aLocSettings the localisation settings file to set
     */
    public void setLocSettings( File aLocSettings )
        {
        iLocSettings = aLocSettings;

        // Verify that localisation settings are found
        if( aLocSettings != null &&
          ( !aLocSettings.exists() || !aLocSettings.isFile() ) )
            {
            throw new IllegalArgumentException(
                    "Localisation settings file not found: " +
                    aLocSettings.getPath() );
            }
        }

    /**
     * Set the properties file.
     * @param aPropFile the properties file to set
     */
    public void setPropFile( File aPropFile )
        {
        iPropFile = aPropFile;

        // Verify that properties file is found
        if( aPropFile != null &&
          ( !aPropFile.exists() || !aPropFile.isFile() ) )
            {
            throw new IllegalArgumentException(
                    "Properties file not found: " +
                    aPropFile.getPath() );
            }
        }
    }