Revision 39143
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.impl/src/main/java/org/gvsig/installer/lib/impl/DefaultDependencies.java | ||
---|---|---|
7 | 7 |
import org.gvsig.installer.lib.api.Dependency; |
8 | 8 |
import org.gvsig.installer.lib.api.Version; |
9 | 9 |
|
10 |
public class DefaultDependencies extends ArrayList<Dependency> implements
|
|
10 |
public class DefaultDependencies extends ArrayList implements |
|
11 | 11 |
Dependencies { |
12 | 12 |
|
13 | 13 |
/** |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.impl/src/main/java/org/gvsig/installer/lib/impl/DefaultPackageInfo.java | ||
---|---|---|
586 | 586 |
return this.categories; |
587 | 587 |
} |
588 | 588 |
|
589 |
public void setCategories(List<String> categoriesList) {
|
|
589 |
public void setCategories(List categoriesList) { |
|
590 | 590 |
for (int i = 0; i < categoriesList.size(); i++) { |
591 | 591 |
if (!this.categories.contains(categoriesList.get(i))) { |
592 |
this.categories.add(categoriesList.get(i)); |
|
592 |
this.categories.add((String) categoriesList.get(i));
|
|
593 | 593 |
} |
594 | 594 |
} |
595 | 595 |
} |
... | ... | |
676 | 676 |
return signed; |
677 | 677 |
} |
678 | 678 |
|
679 |
/* (non-Javadoc) |
|
680 |
* @see org.gvsig.installer.lib.api.PackageInfo#getApplicationVersion() |
|
681 |
*/ |
|
682 |
public Version getApplicationVersion() { |
|
683 |
// TODO Auto-generated method stub |
|
684 |
return null; |
|
685 |
} |
|
686 |
|
|
687 |
/* (non-Javadoc) |
|
688 |
* @see org.gvsig.installer.lib.api.PackageInfo#setApplicationVersion(org.gvsig.installer.lib.api.Version) |
|
689 |
*/ |
|
690 |
public void setApplicationVersion(Version version) { |
|
691 |
// TODO Auto-generated method stub |
|
692 |
|
|
693 |
} |
|
694 |
|
|
695 |
/* (non-Javadoc) |
|
696 |
* @see org.gvsig.installer.lib.api.PackageInfo#setValue(java.lang.String, java.lang.Object) |
|
697 |
*/ |
|
698 |
public void setValue(String name, Object value) { |
|
699 |
// TODO Auto-generated method stub |
|
700 |
|
|
701 |
} |
|
702 |
|
|
703 |
/* (non-Javadoc) |
|
704 |
* @see org.gvsig.installer.lib.api.PackageInfo#getValue(java.lang.String) |
|
705 |
*/ |
|
706 |
public Object getValue(String name) { |
|
707 |
// TODO Auto-generated method stub |
|
708 |
return null; |
|
709 |
} |
|
710 |
|
|
711 |
/* (non-Javadoc) |
|
712 |
* @see org.gvsig.installer.lib.api.PackageInfo#getPreferedPackageFileName() |
|
713 |
*/ |
|
714 |
public String getPreferedPackageFileName() { |
|
715 |
// TODO Auto-generated method stub |
|
716 |
return null; |
|
717 |
} |
|
718 |
|
|
679 | 719 |
} |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.impl/src/main/java/org/gvsig/installer/lib/impl/execution/DefaultInstallPackageService.java | ||
---|---|---|
59 | 59 |
import org.gvsig.installer.lib.spi.InstallerProviderLocator; |
60 | 60 |
import org.gvsig.installer.lib.spi.InstallerProviderManager; |
61 | 61 |
import org.gvsig.installer.lib.spi.execution.InstallPackageProvider; |
62 |
import org.gvsig.tools.exception.BaseException; |
|
62 | 63 |
import org.gvsig.tools.service.Manager; |
63 | 64 |
import org.gvsig.tools.service.ServiceException; |
64 | 65 |
import org.gvsig.tools.task.SimpleTaskStatus; |
... | ... | |
517 | 518 |
|
518 | 519 |
public void downloadPackage(PackageInfo packageInfo, |
519 | 520 |
SimpleTaskStatus taskStatus) throws InstallPackageServiceException { |
520 |
File file = packageInfo.downloadFile(taskStatus); |
|
521 |
|
|
522 |
File file = null; |
|
523 |
|
|
524 |
try { |
|
525 |
file = packageInfo.downloadFile(taskStatus); |
|
526 |
} catch (BaseException e) { |
|
527 |
throw new InstallPackageServiceException(e); |
|
528 |
} |
|
521 | 529 |
this.packageInfoFileMap.put(packageInfo, file); |
522 | 530 |
} |
523 | 531 |
|
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.api/src/main/java/org/gvsig/installer/lib/api/Dependency.java | ||
---|---|---|
1 |
package org.gvsig.installer.lib.api; |
|
2 |
|
|
3 |
import org.gvsig.tools.lang.Cloneable; |
|
4 |
|
|
5 |
public interface Dependency extends Cloneable { |
|
6 |
|
|
7 |
public final String REQUIRED = "required"; |
|
8 |
public final String CONFLICT = "conflict"; |
|
9 |
public final String RECOMMENDED = "recommended"; |
|
10 |
|
|
11 |
public Dependency parse(String dependency); |
|
12 |
|
|
13 |
public String getType(); |
|
14 |
|
|
15 |
public String getCode(); |
|
16 |
|
|
17 |
public String getOp(); |
|
18 |
|
|
19 |
public Version getVersion(); |
|
20 |
|
|
21 |
public boolean match(String type, String code, Version version); |
|
22 |
} |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.api/src/main/java/org/gvsig/installer/lib/api/Version.java | ||
---|---|---|
1 |
package org.gvsig.installer.lib.api; |
|
2 |
|
|
3 |
import org.gvsig.tools.lang.Cloneable; |
|
4 |
|
|
5 |
public interface Version extends Cloneable { |
|
6 |
|
|
7 |
public Version parse(String version); |
|
8 |
|
|
9 |
/** |
|
10 |
* |
|
11 |
* @return |
|
12 |
* @deprecated Use {@link #getMajor()} |
|
13 |
*/ |
|
14 |
public int getMayor(); |
|
15 |
|
|
16 |
public int getMajor(); |
|
17 |
|
|
18 |
public int getMinor(); |
|
19 |
|
|
20 |
public int getRevision(); |
|
21 |
|
|
22 |
public String getClassifier(); |
|
23 |
|
|
24 |
public int getBuild(); |
|
25 |
|
|
26 |
public boolean check(String op, Version other); |
|
27 |
|
|
28 |
public String fullFormat(); |
|
29 |
|
|
30 |
public Version setBuild(int build); |
|
31 |
} |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.api/src/main/java/org/gvsig/installer/lib/api/Dependencies.java | ||
---|---|---|
1 |
package org.gvsig.installer.lib.api; |
|
2 |
|
|
3 |
import java.util.List; |
|
4 |
|
|
5 |
public interface Dependencies extends List<Dependency> { |
|
6 |
|
|
7 |
public Dependencies parse(String dependenies); |
|
8 |
|
|
9 |
public boolean match(String type, String code, Version version); |
|
10 |
|
|
11 |
public Dependency find(String type, String code, Version version); |
|
12 |
|
|
13 |
} |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.api/src/main/java/org/gvsig/installer/lib/api/PackageInfo.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2010 {Prodevelop} {Task} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.installer.lib.api; |
|
29 |
|
|
30 |
import java.io.File; |
|
31 |
import java.net.URL; |
|
32 |
import java.util.List; |
|
33 |
|
|
34 |
import org.gvsig.installer.lib.api.InstallerManager.ARCH; |
|
35 |
import org.gvsig.installer.lib.api.InstallerManager.JVM; |
|
36 |
import org.gvsig.installer.lib.api.InstallerManager.OS; |
|
37 |
import org.gvsig.installer.lib.api.InstallerManager.STATE; |
|
38 |
import org.gvsig.installer.lib.api.execution.InstallPackageServiceException; |
|
39 |
import org.gvsig.tools.lang.Cloneable; |
|
40 |
import org.gvsig.tools.task.SimpleTaskStatus; |
|
41 |
|
|
42 |
/** |
|
43 |
* Information of a package that is used on the installation process. This |
|
44 |
* information is composed by next fields: </br> <li> |
|
45 |
* <lu><b>Code</b>: unique identifier for the package.</lu> <lu><b>Name</b>: |
|
46 |
* name of the package.</lu> <lu><b>Description</b>: brief description of the |
|
47 |
* package functionality</lu> * <lu><b>Version</b>: number of version.</lu> |
|
48 |
* <lu><b>Build</b>: build number.</lu> <lu><b>State</b>: the state of the |
|
49 |
* package (testing, RC1...).</lu> <lu><b>Operating system</b>: the operating |
|
50 |
* system supported (lin, win, mac_10_6, ...).</lu> <lu><b>Architecture</b>: the |
|
51 |
* state of the package (testing, RC1, ...).</lu> <lu><b>JavaVM</b>: the minimum |
|
52 |
* java version supported (1.5, 1.6, ...).</lu> <lu><b>Is Official</b>: if the |
|
53 |
* package is official or if is a not official package.</lu> <lu><b>Type</b>: |
|
54 |
* package type (plugin, theme, translation...). Depending of this value a |
|
55 |
* different installation provider is selected to control the installation |
|
56 |
* process.</lu> <li> |
|
57 |
* |
|
58 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
59 |
*/ |
|
60 |
public interface PackageInfo extends Cloneable { |
|
61 |
|
|
62 |
/** |
|
63 |
* @return Gets the code of the package. |
|
64 |
*/ |
|
65 |
public String getCode(); |
|
66 |
|
|
67 |
public void setCode(String code); |
|
68 |
|
|
69 |
public String getID(); |
|
70 |
|
|
71 |
/** |
|
72 |
* @return Gets the name of the package. |
|
73 |
*/ |
|
74 |
public String getName(); |
|
75 |
|
|
76 |
public void setName(String name); |
|
77 |
|
|
78 |
/** |
|
79 |
* @return Gets the description of the package. |
|
80 |
*/ |
|
81 |
public String getDescription(); |
|
82 |
|
|
83 |
public void setDescription(String description); |
|
84 |
|
|
85 |
/** |
|
86 |
* @return Gets the version of the package. |
|
87 |
*/ |
|
88 |
public Version getVersion(); |
|
89 |
|
|
90 |
public void setVersion(String version); |
|
91 |
|
|
92 |
public void setVersion(Version version); |
|
93 |
|
|
94 |
/** |
|
95 |
* @return Gets the build number of the package. |
|
96 |
*/ |
|
97 |
public int getBuild(); |
|
98 |
|
|
99 |
public void setBuild(int build); |
|
100 |
|
|
101 |
/** |
|
102 |
* @return Gets the state of the package. |
|
103 |
* @see STATE |
|
104 |
*/ |
|
105 |
public String getState(); |
|
106 |
|
|
107 |
/** |
|
108 |
* Sets the state of the package |
|
109 |
* |
|
110 |
* @param state |
|
111 |
* @see STATE |
|
112 |
*/ |
|
113 |
public void setState(String state); |
|
114 |
|
|
115 |
/** |
|
116 |
* @return Gets if the package is official. |
|
117 |
*/ |
|
118 |
public boolean isOfficial(); |
|
119 |
|
|
120 |
public void setOfficial(boolean official); |
|
121 |
|
|
122 |
/** |
|
123 |
* @return Gets the type of the package. |
|
124 |
*/ |
|
125 |
public String getType(); |
|
126 |
|
|
127 |
public void setType(String type); |
|
128 |
|
|
129 |
/** |
|
130 |
* Returns the supported operating system. |
|
131 |
* |
|
132 |
* @return the supported operating system |
|
133 |
* @see OS |
|
134 |
*/ |
|
135 |
public String getOperatingSystem(); |
|
136 |
|
|
137 |
/** |
|
138 |
* Sets the supported operating system. |
|
139 |
* |
|
140 |
* @param operatingSystem |
|
141 |
* the supported operating system |
|
142 |
* @see OS |
|
143 |
*/ |
|
144 |
public void setOperatingSystem(String operatingSystem); |
|
145 |
|
|
146 |
/** |
|
147 |
* Returns the supported hardware architecture. |
|
148 |
* |
|
149 |
* @return the supported hardware architecture |
|
150 |
* @see ARCH |
|
151 |
*/ |
|
152 |
public String getArchitecture(); |
|
153 |
|
|
154 |
/** |
|
155 |
* Sets the supported hardware architecture. |
|
156 |
* |
|
157 |
* @param architecture |
|
158 |
* the supported hardware architecture |
|
159 |
* @see ARCH |
|
160 |
*/ |
|
161 |
public void setArchitecture(String architecture); |
|
162 |
|
|
163 |
/** |
|
164 |
* Returns the supported java vm version. |
|
165 |
* |
|
166 |
* @return the supported java vm version |
|
167 |
* @see JVM |
|
168 |
*/ |
|
169 |
public String getJavaVM(); |
|
170 |
|
|
171 |
/** |
|
172 |
* Sets the supported java vm version. |
|
173 |
* |
|
174 |
* @param javaVM |
|
175 |
* the supported java vm version |
|
176 |
* @see JVM |
|
177 |
*/ |
|
178 |
public void setJavaVM(String javaVM); |
|
179 |
|
|
180 |
/** |
|
181 |
* Returns the supported gvSIG version. |
|
182 |
* |
|
183 |
* @return the supported gvSIG version |
|
184 |
*/ |
|
185 |
public String getGvSIGVersion(); |
|
186 |
|
|
187 |
/** |
|
188 |
* Sets the supported gvSIG version. |
|
189 |
* |
|
190 |
* @param gvSIGVersion |
|
191 |
* the supported gvSIG version |
|
192 |
*/ |
|
193 |
public void setGvSIGVersion(String gvSIGVersion); |
|
194 |
|
|
195 |
/** |
|
196 |
* Returns the package bundle download {@link URL}. |
|
197 |
* |
|
198 |
* May be null if there is no remote URL to download the bundle. |
|
199 |
* |
|
200 |
* @return the package bundle download {@link URL} |
|
201 |
*/ |
|
202 |
public URL getDownloadURL(); |
|
203 |
|
|
204 |
public String getDownloadURLAsString(); |
|
205 |
|
|
206 |
// /** |
|
207 |
// * Returns the package bundle download {@link URL}. |
|
208 |
// * |
|
209 |
// * May be null if there is no remote URL to download the bundle. |
|
210 |
// * |
|
211 |
// * @return the package bundle download {@link URL} |
|
212 |
// */ |
|
213 |
public URL getDownloadURL(URL baseURL); |
|
214 |
|
|
215 |
/** |
|
216 |
* Sets the package bundle download {@link URL}. Optional. |
|
217 |
* |
|
218 |
* @param defaultURL |
|
219 |
* the package bundle download {@link URL} |
|
220 |
*/ |
|
221 |
public void setDownloadURL(URL defaultURL); |
|
222 |
|
|
223 |
public void setDownloadURL(String defaultDownloadURL); |
|
224 |
|
|
225 |
/** |
|
226 |
* Returns the package info model version. |
|
227 |
* |
|
228 |
* @return the package info model version |
|
229 |
*/ |
|
230 |
public String getModelVersion(); |
|
231 |
|
|
232 |
/** |
|
233 |
* Sets the package info model version. |
|
234 |
* |
|
235 |
* @param modelVersion |
|
236 |
* the package info model version |
|
237 |
*/ |
|
238 |
public void setModelVersion(String modelVersion); |
|
239 |
|
|
240 |
public String getOwner(); |
|
241 |
|
|
242 |
/** |
|
243 |
* Sets the package owner. |
|
244 |
* |
|
245 |
* @param owner |
|
246 |
* the package owner |
|
247 |
*/ |
|
248 |
public void setOwner(String owner); |
|
249 |
|
|
250 |
/** |
|
251 |
* Returns the owner's url {@link URL}. |
|
252 |
* |
|
253 |
* @return the owner's url {@link URL} |
|
254 |
*/ |
|
255 |
public URL getOwnerURL(); |
|
256 |
|
|
257 |
/** |
|
258 |
* Sets the package owner's url. |
|
259 |
* |
|
260 |
* @param sources |
|
261 |
* the package owner's url |
|
262 |
*/ |
|
263 |
public void setOwnerURL(URL sources); |
|
264 |
|
|
265 |
/** |
|
266 |
* Returns the package source files url {@link URL}. |
|
267 |
* |
|
268 |
* @return the package source files url {@link URL} |
|
269 |
*/ |
|
270 |
public URL getSourcesURL(); |
|
271 |
|
|
272 |
/** |
|
273 |
* Sets the package sources. |
|
274 |
* |
|
275 |
* @param sources |
|
276 |
* the package sources |
|
277 |
*/ |
|
278 |
public void setSourcesURL(URL sources); |
|
279 |
|
|
280 |
/** |
|
281 |
* Returns the package web url {@link URL}. |
|
282 |
* |
|
283 |
* @return the package web url {@link URL} |
|
284 |
*/ |
|
285 |
public URL getWebURL(); |
|
286 |
|
|
287 |
/** |
|
288 |
* Sets the package web url {@link URL}. |
|
289 |
* |
|
290 |
* @param webURL |
|
291 |
* the package web url {@link URL} |
|
292 |
*/ |
|
293 |
public void setWebURL(URL webURL); |
|
294 |
|
|
295 |
/** |
|
296 |
* Gets the ant script that has to be executed in the installation process. |
|
297 |
* |
|
298 |
* @return the script. |
|
299 |
*/ |
|
300 |
public String getAntScript(); |
|
301 |
|
|
302 |
/** |
|
303 |
* Sets the ant script that can be executed in the installation process. |
|
304 |
* |
|
305 |
* @param antScript |
|
306 |
* The ant script to copy. |
|
307 |
*/ |
|
308 |
public void setAntScript(String antScript); |
|
309 |
|
|
310 |
public File downloadFile() throws InstallPackageServiceException; |
|
311 |
|
|
312 |
public File downloadFile(SimpleTaskStatus taskStatus) |
|
313 |
throws InstallPackageServiceException; |
|
314 |
|
|
315 |
/** |
|
316 |
* @return |
|
317 |
*/ |
|
318 |
public void addFileToCopy(File file); |
|
319 |
|
|
320 |
public File getFileToCopy(int i); |
|
321 |
|
|
322 |
public void removeFileToCopy(File file); |
|
323 |
|
|
324 |
public void clearFilesToCopy(); |
|
325 |
|
|
326 |
public List<File> getFilesToCopy(); |
|
327 |
|
|
328 |
/** |
|
329 |
* @param folder |
|
330 |
* @return |
|
331 |
*/ |
|
332 |
public boolean removeInstallFolder(File folder); |
|
333 |
|
|
334 |
public boolean removeFilesFolder(File folder); |
|
335 |
|
|
336 |
/** |
|
337 |
* @param string |
|
338 |
* @return |
|
339 |
*/ |
|
340 |
public boolean matchID(String string); |
|
341 |
|
|
342 |
public Dependencies getDependencies(); |
|
343 |
|
|
344 |
public void setDependencies(String dependencies); |
|
345 |
|
|
346 |
public void setDependencies(Dependencies dependencies); |
|
347 |
|
|
348 |
public String toStringCompact(); |
|
349 |
|
|
350 |
public List<String> getCategories(); |
|
351 |
|
|
352 |
public void setCategories(List<String> categoriesList); |
|
353 |
|
|
354 |
public String getCategoriesAsString(); |
|
355 |
|
|
356 |
public void addCategoriesAsString(String categoriesString); |
|
357 |
|
|
358 |
public boolean isSigned(); |
|
359 |
|
|
360 |
public boolean isBroken(); |
|
361 |
|
|
362 |
public void checkSignature(byte[] pkgdata); |
|
363 |
|
|
364 |
} |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.swing/org.gvsig.installer.swing.impl/src/main/java/org/gvsig/installer/swing/impl/DefaultSwingInstallerManager.java | ||
---|---|---|
166 | 166 |
|
167 | 167 |
public void addDefaultDownloadURL(String url) throws MalformedURLException { |
168 | 168 |
Version version = getInstallerManager().createVersion(); |
169 |
String versionFormat = version.getMayor() + "." + version.getMinor()
|
|
169 |
String versionFormat = version.getMajor() + "." + version.getMinor()
|
|
170 | 170 |
+ "." + version.getRevision(); |
171 | 171 |
url = url.replace("$version", versionFormat); |
172 | 172 |
url = url.replace("<%Version%>", versionFormat); |
Also available in: Unified diff