Revision 32333 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/creation/InstallerCreationService.java
InstallerCreationService.java | ||
---|---|---|
33 | 33 |
import org.gvsig.installer.lib.api.InstallerInfo; |
34 | 34 |
|
35 | 35 |
/** |
36 |
* <p> |
|
37 |
* This service is used to create an installer for a gvSIG plugin. It |
|
38 |
* supports just one plugin for every installer. It contains a method to |
|
39 |
* set the plugin path and some methods to set the installer information. |
|
40 |
* </p> |
|
41 |
* |
|
42 |
* <p> |
|
43 |
* It has also methods to load the current installation information (if exists) |
|
44 |
* and methods to create the installer file from an {@link OutputStream}. |
|
45 |
* </p> |
|
46 |
* |
|
47 |
* <p> |
|
48 |
* An installer is just a compressed zip file that has a compressed zip file |
|
49 |
* for every plugin to install. In this first version it only has a plugin, but |
|
50 |
* in a future it is possible to create installers with more that one plugin. |
|
51 |
* The structure of an installation file is: |
|
52 |
* </p> |
|
53 |
* <pre> |
|
54 |
* - installer.zip |
|
55 |
* - org.gvsig.myplugin-[version]-[build].zip |
|
56 |
* - org.gvsig.myplugin |
|
57 |
* - install.info |
|
58 |
* - install.xml |
|
59 |
* - files |
|
60 |
* - org.gvsig.otherplugin |
|
61 |
* - file1 |
|
62 |
* - file2 |
|
63 |
* </pre> |
|
64 |
* <p> |
|
65 |
* installer.zip is the installer file name that has a zip file that |
|
66 |
* contains the plugin to install (org.gvsig.myplugin-[version]-[build].zip). |
|
67 |
* This second file has a root directory with the plugin content and with |
|
68 |
* some extra files with the installer information. These files are: |
|
69 |
* </p> |
|
70 |
* |
|
71 |
* <lu> |
|
72 |
* <li><b>install.info</b>: file that contains the installer information</li> |
|
73 |
* <li><b>install.xml</b>: ant file that is executed in the execution of the installer |
|
74 |
* to do some extra actions in the installation process. One of these actions |
|
75 |
* is copy all the files located in the files directory</li> |
|
76 |
* <li><b>files directory</b>: it contains some files of other extensions that have |
|
77 |
* to be copied using the ant script.</li> |
|
78 |
* </lu> |
|
79 |
* |
|
80 |
* <p> |
|
81 |
* The usage of the ant script to copy files from other plugins is not recommended |
|
82 |
* because it is possible that different installers overrides the same file. The |
|
83 |
* suggestion it that one plugin has to have all the files that it needs to work |
|
84 |
* inside the plugin and it never has to override some external files. |
|
85 |
* </p> |
|
36 | 86 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
37 | 87 |
*/ |
38 | 88 |
public interface InstallerCreationService { |
39 | 89 |
|
90 |
/** |
|
91 |
* It returns an instance of an {@link InstallerInfo} class, that is a |
|
92 |
* class that contains all the installer information (plugin name, plugin |
|
93 |
* version...). |
|
94 |
* @return |
|
95 |
* The installer information. |
|
96 |
*/ |
|
40 | 97 |
public InstallerInfo getInstallerInfo(); |
41 | 98 |
|
99 |
/** |
|
100 |
* It sets the directory where the plugin is located, that it has to |
|
101 |
* be a valid gvSIG plugin directory. |
|
102 |
* @param pluginDirectory |
|
103 |
* The directory where the gvSIG plugin is located. |
|
104 |
* @throws InstallerCreationServiceException |
|
105 |
* This exception is thrown when the directory doesn't exist or the directory is |
|
106 |
* not a valid gvSIG plugin directory. |
|
107 |
*/ |
|
42 | 108 |
public void setPluginDirectory(File pluginDirectory) throws InstallerCreationServiceException; |
43 | 109 |
|
110 |
/** |
|
111 |
* This method reads the install.info file and loads the installation information |
|
112 |
* into the current installer creation process. It also reads the information to |
|
113 |
* copy some external files and add them to the current installer creation execution. |
|
114 |
* @throws InstallerCreationServiceException |
|
115 |
* This exception is thrown when the directory is not valid gvSIG plugin directory. |
|
116 |
*/ |
|
44 | 117 |
public void loadInstallInfoFromDirectory() throws InstallerCreationServiceException; |
45 | 118 |
|
119 |
/** |
|
120 |
* It creates the installer file and copy it in the stream received like |
|
121 |
* an argument. |
|
122 |
* @param installerStream |
|
123 |
* The stream where the the installer is created |
|
124 |
* @throws InstallerCreationServiceException |
|
125 |
* It is thrown when there is an exception creating the installer. |
|
126 |
*/ |
|
46 | 127 |
public void createInstaller(OutputStream installerStream) throws InstallerCreationServiceException; |
47 | 128 |
|
48 | 129 |
} |
Also available in: Unified diff