themeinstaller/source/src/com/nokia/tools/themeinstaller/defrep/operations/FileOperationEvent.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:  An event for informing about file operation completion
 *
*/


package com.nokia.tools.themeinstaller.defrep.operations;

import java.io.File;

public class FileOperationEvent
    {

    // CONSTANTS
    public static final int OPERATION_SUCCESSFUL = 0;
    public static final int FILE_NOT_FOUND_ERROR = -1;
    public static final int IO_ERROR = -2;
    public static final int UNKNOWN_ERROR = -3;

    // The file related to the operation
    private File iFile;

    // Destination file of the operation (in Symbian OS filesystem)
    private String iDestPath;

    // Error code of the finished operation
    private int iErrorCode;

    /**
     * File operation event constructor.
     *
     * @param aFileName File related to the event
     * @param aErrorCode Error code of the completed operation
     */
    public FileOperationEvent( File aFile, int aErrorCode )
        {
        iFile = aFile;
        iErrorCode = aErrorCode;
        iDestPath = FileOperationUtils.parseSymbianFSPath( iFile );
        }

    /**
     * Get the file.
     * @return The file
     */
    public File getFile()
        {
        return iFile;
        }

    /**
     * Get the error code.
     * @return The error code
     */
    public int getErrorCode()
        {
        return iErrorCode;
        }

    /**
     * Get the destination path in Symbian OS file system.
     * @return the iDestPath Destination path
     */
    public String getDestPath()
        {
        return iDestPath;
        }
    
    /**
     * Get the full destination path in PC file system.
     * @return the iFile's path
     */
    public String getFullDestPath()
        {
        return iFile.getPath();
        }
    }