|
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: Installation parameters for starting the Installation Manager |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 package com.nokia.tools.themeinstaller.installationmanager; |
|
20 |
|
21 import java.io.File; |
|
22 |
|
23 /** |
|
24 * Installation parameters for starting the Installation Manager. |
|
25 */ |
|
26 public class InstallationParameters |
|
27 { |
|
28 |
|
29 // Manifest file |
|
30 private File iManifest; |
|
31 |
|
32 // Destination directory |
|
33 private File iDestinationDir; |
|
34 |
|
35 // Localisation settings |
|
36 private File iLocSettings; |
|
37 |
|
38 // External properties file |
|
39 private File iPropFile; |
|
40 |
|
41 /** |
|
42 * Constructor. |
|
43 * @param aManifest Manifest file |
|
44 * @param aDestinationDir Destination directory |
|
45 */ |
|
46 public InstallationParameters( File aManifest, File aDestinationDir ) |
|
47 { |
|
48 iManifest = aManifest; |
|
49 iDestinationDir = aDestinationDir; |
|
50 |
|
51 // Verify that theme manifest exists |
|
52 if( !aManifest.exists() ) |
|
53 { |
|
54 throw new IllegalArgumentException( |
|
55 "Manifest file not found: " + aManifest.getPath() ); |
|
56 } |
|
57 |
|
58 // Verify that destination directory is not an existing file |
|
59 if( aDestinationDir.isFile() ) |
|
60 { |
|
61 throw new IllegalArgumentException( "Invalid destination directory: " + |
|
62 aDestinationDir.getPath() ); |
|
63 } |
|
64 } |
|
65 |
|
66 /** |
|
67 * Get the manifest file. |
|
68 * @return the manifest file |
|
69 */ |
|
70 public File getManifest() |
|
71 { |
|
72 return iManifest; |
|
73 } |
|
74 |
|
75 /** |
|
76 * Get the destination directory. |
|
77 * @return the destination directory |
|
78 */ |
|
79 public File getDestinationDir() |
|
80 { |
|
81 return iDestinationDir; |
|
82 } |
|
83 |
|
84 /** |
|
85 * Get the localisation settings file. |
|
86 * @return the localisation settings file |
|
87 */ |
|
88 public File getLocSettings() |
|
89 { |
|
90 return iLocSettings; |
|
91 } |
|
92 |
|
93 /** |
|
94 * Get the properties file. |
|
95 * @return the properties file |
|
96 */ |
|
97 public File getPropFile() |
|
98 { |
|
99 return iPropFile; |
|
100 } |
|
101 |
|
102 /** |
|
103 * Set the localisation settings file. |
|
104 * @param aLocSettings the localisation settings file to set |
|
105 */ |
|
106 public void setLocSettings( File aLocSettings ) |
|
107 { |
|
108 iLocSettings = aLocSettings; |
|
109 |
|
110 // Verify that localisation settings are found |
|
111 if( aLocSettings != null && |
|
112 ( !aLocSettings.exists() || !aLocSettings.isFile() ) ) |
|
113 { |
|
114 throw new IllegalArgumentException( |
|
115 "Localisation settings file not found: " + |
|
116 aLocSettings.getPath() ); |
|
117 } |
|
118 } |
|
119 |
|
120 /** |
|
121 * Set the properties file. |
|
122 * @param aPropFile the properties file to set |
|
123 */ |
|
124 public void setPropFile( File aPropFile ) |
|
125 { |
|
126 iPropFile = aPropFile; |
|
127 |
|
128 // Verify that properties file is found |
|
129 if( aPropFile != null && |
|
130 ( !aPropFile.exists() || !aPropFile.isFile() ) ) |
|
131 { |
|
132 throw new IllegalArgumentException( |
|
133 "Properties file not found: " + |
|
134 aPropFile.getPath() ); |
|
135 } |
|
136 } |
|
137 } |