|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: An event for informing about file operation completion |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 package com.nokia.tools.themeinstaller.defrep.operations; |
|
20 |
|
21 import java.io.File; |
|
22 |
|
23 public class FileOperationEvent |
|
24 { |
|
25 |
|
26 // CONSTANTS |
|
27 public static final int OPERATION_SUCCESSFUL = 0; |
|
28 public static final int FILE_NOT_FOUND_ERROR = -1; |
|
29 public static final int IO_ERROR = -2; |
|
30 public static final int UNKNOWN_ERROR = -3; |
|
31 |
|
32 // The file related to the operation |
|
33 private File iFile; |
|
34 |
|
35 // Destination file of the operation (in Symbian OS filesystem) |
|
36 private String iDestPath; |
|
37 |
|
38 // Error code of the finished operation |
|
39 private int iErrorCode; |
|
40 |
|
41 /** |
|
42 * File operation event constructor. |
|
43 * |
|
44 * @param aFileName File related to the event |
|
45 * @param aErrorCode Error code of the completed operation |
|
46 */ |
|
47 public FileOperationEvent( File aFile, int aErrorCode ) |
|
48 { |
|
49 iFile = aFile; |
|
50 iErrorCode = aErrorCode; |
|
51 iDestPath = FileOperationUtils.parseSymbianFSPath( iFile ); |
|
52 } |
|
53 |
|
54 /** |
|
55 * Get the file. |
|
56 * @return The file |
|
57 */ |
|
58 public File getFile() |
|
59 { |
|
60 return iFile; |
|
61 } |
|
62 |
|
63 /** |
|
64 * Get the error code. |
|
65 * @return The error code |
|
66 */ |
|
67 public int getErrorCode() |
|
68 { |
|
69 return iErrorCode; |
|
70 } |
|
71 |
|
72 /** |
|
73 * Get the destination path in Symbian OS file system. |
|
74 * @return the iDestPath Destination path |
|
75 */ |
|
76 public String getDestPath() |
|
77 { |
|
78 return iDestPath; |
|
79 } |
|
80 |
|
81 /** |
|
82 * Get the full destination path in PC file system. |
|
83 * @return the iFile's path |
|
84 */ |
|
85 public String getFullDestPath() |
|
86 { |
|
87 return iFile.getPath(); |
|
88 } |
|
89 } |