Revision 32585
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.main/src/test/resources/application/gvSIG/extensiones/org.gvsig.plugin1/install.info | ||
---|---|---|
1 |
code=org.gvsig.myplugin |
|
2 |
name=myplugin |
|
3 |
description=Test |
|
4 |
version=1.0.0 |
|
5 |
build=1 |
|
6 |
state=RC1 |
|
7 |
oficial=true |
|
8 |
type=plugin |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.main/src/test/resources/application/gvSIG/extensiones/org.gvsig.plugin1/package.info | ||
---|---|---|
1 |
code=org.gvsig.myplugin |
|
2 |
name=myplugin |
|
3 |
description=Test |
|
4 |
version=1.0.0 |
|
5 |
build=1 |
|
6 |
state=RC1 |
|
7 |
oficial=true |
|
8 |
type=plugin |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.main/src/test/resources/application/gvSIG/extensiones/org.gvsig.plugin2/install.info | ||
---|---|---|
1 |
code=org.gvsig.myplugin2 |
|
2 |
name=myplugin |
|
3 |
description=Test |
|
4 |
version=1.0.0 |
|
5 |
build=1 |
|
6 |
state=RC1 |
|
7 |
oficial=true |
|
8 |
type=plugin |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.main/src/test/resources/application/gvSIG/extensiones/org.gvsig.plugin2/package.info | ||
---|---|---|
1 |
code=org.gvsig.myplugin2 |
|
2 |
name=myplugin |
|
3 |
description=Test |
|
4 |
version=1.0.0 |
|
5 |
build=1 |
|
6 |
state=RC1 |
|
7 |
oficial=true |
|
8 |
type=plugin |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.main/src/test/resources/application/gvSIG/extensiones/org.gvsig.plugin3/install.info | ||
---|---|---|
1 |
code=org.gvsig.plugin3 |
|
2 |
name=myplugin |
|
3 |
description=Test |
|
4 |
version=1.0.0 |
|
5 |
build=1 |
|
6 |
state=RC1 |
|
7 |
oficial=true |
|
8 |
type=plugin |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.main/src/test/resources/application/gvSIG/extensiones/org.gvsig.plugin3/package.info | ||
---|---|---|
1 |
code=org.gvsig.plugin3 |
|
2 |
name=myplugin |
|
3 |
description=Test |
|
4 |
version=1.0.0 |
|
5 |
build=1 |
|
6 |
state=RC1 |
|
7 |
oficial=true |
|
8 |
type=plugin |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.main/src/test/java/org/gvsig/installer/main/utils/CreateBundleLauncher.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.main.utils; |
|
29 |
/** |
|
30 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
31 |
*/ |
|
32 |
public class CreateBundleLauncher { |
|
33 |
|
|
34 |
public static void main(String[] args){ |
|
35 |
new CreateBundleLauncher(); |
|
36 |
} |
|
37 |
|
|
38 |
public CreateBundleLauncher() { |
|
39 |
super(); |
|
40 |
CreateBoundleFrame createBoundleFrame = new CreateBoundleFrame(); |
|
41 |
createBoundleFrame.setBounds(0, 0, 500, 150); |
|
42 |
createBoundleFrame.setVisible(true); |
|
43 |
} |
|
44 |
|
|
45 |
|
|
46 |
} |
|
47 |
|
|
0 | 48 |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.main/src/main/java/org/gvsig/installer/main/utils/CreateBoundleFrame.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.main.utils; |
|
29 |
|
|
30 |
import java.awt.HeadlessException; |
|
31 |
import java.awt.event.ActionEvent; |
|
32 |
import java.awt.event.ActionListener; |
|
33 |
import java.awt.event.WindowEvent; |
|
34 |
import java.awt.event.WindowListener; |
|
35 |
import java.io.File; |
|
36 |
import java.io.FileNotFoundException; |
|
37 |
import java.io.FileOutputStream; |
|
38 |
import java.util.ArrayList; |
|
39 |
import java.util.List; |
|
40 |
|
|
41 |
import javax.swing.JFrame; |
|
42 |
import javax.swing.JOptionPane; |
|
43 |
|
|
44 |
import org.gvsig.gui.beans.openfile.FileTextField; |
|
45 |
import org.gvsig.installer.lib.api.creation.MakePluginPackageServiceException; |
|
46 |
import org.gvsig.installer.lib.impl.utils.Compress; |
|
47 |
|
|
48 |
/** |
|
49 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
|
50 |
*/ |
|
51 |
public class CreateBoundleFrame extends JFrame implements WindowListener, ActionListener { |
|
52 |
private javax.swing.JButton executeButton; |
|
53 |
private javax.swing.JLabel inputLabel; |
|
54 |
private FileTextField inputText; |
|
55 |
private javax.swing.JLabel jLabel2; |
|
56 |
private FileTextField outputText; |
|
57 |
|
|
58 |
public CreateBoundleFrame() throws HeadlessException { |
|
59 |
super(); |
|
60 |
initializeComponents(); |
|
61 |
this.addWindowListener(this); |
|
62 |
executeButton.addActionListener(this); |
|
63 |
} |
|
64 |
|
|
65 |
private void initializeComponents() { |
|
66 |
java.awt.GridBagConstraints gridBagConstraints; |
|
67 |
|
|
68 |
inputLabel = new javax.swing.JLabel(); |
|
69 |
executeButton = new javax.swing.JButton(); |
|
70 |
inputText = new FileTextField(); |
|
71 |
outputText = new FileTextField(); |
|
72 |
jLabel2 = new javax.swing.JLabel(); |
|
73 |
|
|
74 |
setLayout(new java.awt.GridBagLayout()); |
|
75 |
|
|
76 |
inputLabel.setText("Input directory"); |
|
77 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
78 |
gridBagConstraints.gridx = 0; |
|
79 |
gridBagConstraints.gridy = 0; |
|
80 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; |
|
81 |
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); |
|
82 |
add(inputLabel, gridBagConstraints); |
|
83 |
|
|
84 |
executeButton.setText("Execute"); |
|
85 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
86 |
gridBagConstraints.gridx = 1; |
|
87 |
gridBagConstraints.gridy = 2; |
|
88 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; |
|
89 |
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); |
|
90 |
add(executeButton, gridBagConstraints); |
|
91 |
|
|
92 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
93 |
gridBagConstraints.gridx = 1; |
|
94 |
gridBagConstraints.gridy = 0; |
|
95 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
96 |
gridBagConstraints.ipadx = 67; |
|
97 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; |
|
98 |
gridBagConstraints.weightx = 1.0; |
|
99 |
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); |
|
100 |
add(inputText, gridBagConstraints); |
|
101 |
|
|
102 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
103 |
gridBagConstraints.gridx = 1; |
|
104 |
gridBagConstraints.gridy = 1; |
|
105 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
106 |
gridBagConstraints.ipadx = 67; |
|
107 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; |
|
108 |
gridBagConstraints.weightx = 1.0; |
|
109 |
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); |
|
110 |
add(outputText, gridBagConstraints); |
|
111 |
|
|
112 |
jLabel2.setText("Output"); |
|
113 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
114 |
gridBagConstraints.gridx = 0; |
|
115 |
gridBagConstraints.gridy = 1; |
|
116 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; |
|
117 |
gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2); |
|
118 |
add(jLabel2, gridBagConstraints); |
|
119 |
|
|
120 |
} |
|
121 |
|
|
122 |
public void windowActivated(WindowEvent arg0) { |
|
123 |
// TODO Auto-generated method stub |
|
124 |
|
|
125 |
} |
|
126 |
|
|
127 |
public void windowClosed(WindowEvent arg0) { |
|
128 |
System.exit(0); |
|
129 |
|
|
130 |
} |
|
131 |
|
|
132 |
public void windowClosing(WindowEvent arg0) { |
|
133 |
// TODO Auto-generated method stub |
|
134 |
|
|
135 |
} |
|
136 |
|
|
137 |
public void windowDeactivated(WindowEvent arg0) { |
|
138 |
// TODO Auto-generated method stub |
|
139 |
|
|
140 |
} |
|
141 |
|
|
142 |
public void windowDeiconified(WindowEvent arg0) { |
|
143 |
// TODO Auto-generated method stub |
|
144 |
|
|
145 |
} |
|
146 |
|
|
147 |
public void windowIconified(WindowEvent arg0) { |
|
148 |
// TODO Auto-generated method stub |
|
149 |
|
|
150 |
} |
|
151 |
|
|
152 |
public void windowOpened(WindowEvent arg0) { |
|
153 |
// TODO Auto-generated method stub |
|
154 |
|
|
155 |
} |
|
156 |
|
|
157 |
public void actionPerformed(ActionEvent arg0) { |
|
158 |
File inputDirectory = inputText.getSelectedFile(); |
|
159 |
File outputFile = outputText.getSelectedFile(); |
|
160 |
|
|
161 |
if (!inputDirectory.exists()){ |
|
162 |
JOptionPane.showMessageDialog(this, "Input directory doesn't exist"); |
|
163 |
return; |
|
164 |
} |
|
165 |
|
|
166 |
if (outputFile.exists()){ |
|
167 |
outputFile.delete(); |
|
168 |
} |
|
169 |
|
|
170 |
Compress compress = new Compress(); |
|
171 |
try { |
|
172 |
File[] files = inputDirectory.listFiles(); |
|
173 |
List<File> filesArray = new ArrayList<File>(); |
|
174 |
List<String> fileNamesArray = new ArrayList<String>(); |
|
175 |
for (int i=0 ; i<files.length ; i++){ |
|
176 |
if (!files[i].getName().toUpperCase().equals(".SVN")){ |
|
177 |
filesArray.add(files[i]); |
|
178 |
fileNamesArray.add(files[i].getName()); |
|
179 |
} |
|
180 |
} |
|
181 |
compress.compressPlugins(filesArray, fileNamesArray, new FileOutputStream(outputFile)); |
|
182 |
} catch (Exception e) { |
|
183 |
JOptionPane.showMessageDialog(this, e.toString()); |
|
184 |
} |
|
185 |
} |
|
186 |
} |
|
187 |
|
|
0 | 188 |
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/InstallerManager.java | ||
---|---|---|
38 | 38 |
/** |
39 | 39 |
* <p> |
40 | 40 |
* This manager is used to register and create the services that are used |
41 |
* to manage the plugin installers. The services that offers are basically |
|
42 |
* two: the creation of installers service and the execution of installers |
|
41 |
* to manage the creation and the execution of installers. An installer is |
|
42 |
* a file called <b>bundle</b> that is composed of a set <b>packages</b>. |
|
43 |
* </p> |
|
44 |
* <p> |
|
45 |
* A package has some information that is defined by the {@link PackageInfo} |
|
46 |
* class and is composed of a set of attributes. One of these attributes, |
|
47 |
* the type, denotes if the package is a plugin, theme, translation, etc. |
|
48 |
* </p> |
|
49 |
* <p> |
|
50 |
* In practice a bundle is just a compressed zip file that has a compressed zip file |
|
51 |
* for every package to install. The structure of a bundle file with two |
|
52 |
* packages of type plugin could be: |
|
53 |
* </p> |
|
54 |
* <pre> |
|
55 |
* - bundle (compressed file) |
|
56 |
* - org.gvsig.plugin1-1_0_0-23 (compressed file) |
|
57 |
* - org.gvsig.plugin1 |
|
58 |
* - package.info |
|
59 |
* - org.gvsig.plugin2-2_0_1-35 (compressed file) |
|
60 |
* - org.gvsig.plugin1 |
|
61 |
* - package.info |
|
62 |
* </pre> |
|
63 |
* <p> |
|
64 |
* bundle is the compressed file that contains a zip entry for every |
|
65 |
* package to install. The name of the zip entry follows next pattern: |
|
66 |
* </p> |
|
67 |
* <pre> |
|
68 |
* [package code]-[version]-[build] |
|
69 |
* </pre> |
|
70 |
* <p> |
|
71 |
* Every zip entry contains a main folder inside that contains all the |
|
72 |
* package files that are used in the installation process. Depending of the |
|
73 |
* type of packages, the information inside this folder can be different, |
|
74 |
* but all the types of packages have to have the <b>package.info</b> that |
|
75 |
* has all the package information. To see the <b>package.info</b> description |
|
76 |
* see {@link PackageInfo}. |
|
77 |
* <p> |
|
78 |
* </p> |
|
79 |
* The services that offers this managers are basically two: the creation of |
|
80 |
* bundles for just one package of type plugin and a service for the |
|
81 |
* installation of packages. |
|
43 | 82 |
* service. |
44 | 83 |
* </p> |
45 | 84 |
* |
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/utils/Compress.java | ||
---|---|---|
48 | 48 |
public class Compress { |
49 | 49 |
static final int BUFFER = 2048; |
50 | 50 |
private static final Logger logger = LoggerFactory.getLogger(Compress.class); |
51 |
|
|
51 |
|
|
52 | 52 |
public Compress() { |
53 | 53 |
super(); |
54 | 54 |
} |
... | ... | |
61 | 61 |
compressPlugins(files, fileNames, os); |
62 | 62 |
} |
63 | 63 |
|
64 |
public void compressPlugins(File directory, OutputStream os) throws MakePluginPackageServiceException{ |
|
65 |
File[] files = directory.listFiles(); |
|
66 |
List<File> filesArray = new ArrayList<File>(); |
|
67 |
List<String> fileNamesArray = new ArrayList<String>(); |
|
68 |
for (int i=0 ; i<files.length ; i++){ |
|
69 |
filesArray.add(files[i]); |
|
70 |
fileNamesArray.add(files[i].getName()); |
|
71 |
} |
|
72 |
compressPlugins(filesArray, fileNamesArray, os); |
|
73 |
} |
|
74 |
|
|
75 |
|
|
64 | 76 |
public void compressPlugins(List<File> files, List<String> fileNames, OutputStream os) throws MakePluginPackageServiceException { |
65 | 77 |
try{ |
66 | 78 |
ZipOutputStream zos = new ZipOutputStream(new BufferedOutputStream(os)); |
67 |
|
|
79 |
|
|
68 | 80 |
for (int i=0 ; i<files.size() ; i++){ |
69 | 81 |
File file = files.get(i); |
70 |
|
|
82 |
|
|
71 | 83 |
int parentFileLenght = file.getParentFile().toString().length(); |
72 | 84 |
|
73 |
ZipEntry zipEntry = new ZipEntry(fileNames.get(i));
|
|
85 |
ZipEntry zipEntry = new ZipEntry(fileNames.get(i)); |
|
74 | 86 |
zos.putNextEntry(zipEntry); |
75 |
|
|
87 |
|
|
76 | 88 |
ZipOutputStream zosPlugin = new ZipOutputStream(zos); |
77 | 89 |
compressPluginFile(file, parentFileLenght, zosPlugin); |
78 | 90 |
zosPlugin.finish(); |
79 |
|
|
80 |
zos.closeEntry(); |
|
81 |
|
|
82 |
zos.close(); |
|
91 |
|
|
92 |
zos.closeEntry(); |
|
83 | 93 |
} |
84 | 94 |
zos.close(); |
85 | 95 |
} catch (Exception e) { |
... | ... | |
90 | 100 |
|
91 | 101 |
|
92 | 102 |
private void compressPluginFile(File file, int parenFileLength, ZipOutputStream zosPlugin) throws IOException { |
103 |
String fileName = file.toString().substring(parenFileLength, file.toString().length()); |
|
104 |
|
|
93 | 105 |
if (file.isDirectory()) { |
94 |
String[] fileNames = file.list(); |
|
95 |
if (fileNames != null) { |
|
96 |
for (int i=0; i<fileNames.length; i++) { |
|
97 |
compressPluginFile(new File(file, fileNames[i]), parenFileLength, zosPlugin); |
|
106 |
//Remove the subversion folders |
|
107 |
if (!file.getName().toUpperCase().equals(".SVN")){ |
|
108 |
//Adding the files |
|
109 |
String[] fileNames = file.list(); |
|
110 |
if (fileNames != null) { |
|
111 |
for (int i=0; i<fileNames.length; i++) { |
|
112 |
compressPluginFile(new File(file, fileNames[i]), parenFileLength, zosPlugin); |
|
113 |
} |
|
98 | 114 |
} |
99 | 115 |
} |
100 | 116 |
}else{ |
101 | 117 |
byte[] buf = new byte[1024]; |
102 |
int len; |
|
118 |
int len;
|
|
103 | 119 |
|
104 |
String fileName = file.toString().substring(parenFileLength, file.toString().length()); |
|
105 |
|
|
106 | 120 |
ZipEntry zipEntry = new ZipEntry(fileName); |
107 | 121 |
zosPlugin.putNextEntry(zipEntry); |
108 |
|
|
122 |
|
|
109 | 123 |
FileInputStream fin = new FileInputStream(file); |
110 | 124 |
BufferedInputStream in = new BufferedInputStream(fin); |
111 | 125 |
while ((len = in.read(buf)) >= 0) { |
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/utils/Decompress.java | ||
---|---|---|
161 | 161 |
while((entry = zipInputStream.getNextEntry()) != null) { |
162 | 162 |
logger.debug("Extracting: " + entry.getName()); |
163 | 163 |
|
164 |
if (entry.getName().endsWith(File.separator + "install.info")){
|
|
164 |
if (entry.getName().endsWith(File.separator + "package.info")){
|
|
165 | 165 |
PackageInfo installerInfo = readInstallInfo(zipInputStream); |
166 | 166 |
zipEntriesMap.put(installerInfo, zipEntryName); |
167 | 167 |
readedIinstallerInfos.add(installerInfo); |
... | ... | |
195 | 195 |
if (entry.isDirectory()){ |
196 | 196 |
file.mkdir(); |
197 | 197 |
}else{ |
198 |
FileOutputStream fos = new FileOutputStream(outputDirectory.getAbsolutePath() + File.separator + entry.getName()); |
|
198 |
createParentFolder(file); |
|
199 |
FileOutputStream fos = new FileOutputStream(file); |
|
199 | 200 |
|
200 | 201 |
while ((count = zipInputStream.read(data, 0, BUFFER)) != -1) { |
201 | 202 |
fos.write(data, 0, count); |
202 | 203 |
} |
203 | 204 |
fos.flush(); |
204 | 205 |
fos.close(); |
205 |
} |
|
206 |
//zipInputStream.closeEntry(); |
|
206 |
} |
|
207 | 207 |
} |
208 | 208 |
} |
209 | 209 |
|
210 |
private void createParentFolder(File file) { |
|
211 |
File parentFile = file.getParentFile(); |
|
212 |
if (!parentFile.exists()){ |
|
213 |
createParentFolder(parentFile); |
|
214 |
parentFile.mkdir(); |
|
215 |
} |
|
216 |
} |
|
217 |
|
|
210 | 218 |
public boolean delete(File dir) { |
211 | 219 |
if (dir.isDirectory()){ |
212 | 220 |
String[] children = dir.list(); |
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/DefaultInstallerProviderServices.java | ||
---|---|---|
48 | 48 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a> |
49 | 49 |
*/ |
50 | 50 |
public class DefaultInstallerProviderServices extends AbstractProviderServices implements InstallerProviderServices{ |
51 |
private static final String INSTALL_INFO_FILE = "install.info";
|
|
51 |
private static final String INSTALL_INFO_FILE = "package.info";
|
|
52 | 52 |
|
53 | 53 |
public void decompress(InputStream is, File outputDirectory) throws InstallPackageServiceException { |
54 | 54 |
Decompress decompress = new Decompress(); |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.impl/src/test/java/org/gvsig/installer/lib/impl/execution/InstallPackageServiceTest.java | ||
---|---|---|
70 | 70 |
}else if (packageInfo.getCode().equals("org.gvsig.plugin2")){ |
71 | 71 |
assertEquals("RC1", packageInfo.getState()); |
72 | 72 |
pluginsNumber++; |
73 |
}else if (packageInfo.getCode().equals("org.gvsig.plugin3.zip")){
|
|
73 |
}else if (packageInfo.getCode().equals("org.gvsig.plugin3")){ |
|
74 | 74 |
assertEquals("Testing", packageInfo.getState()); |
75 | 75 |
pluginsNumber++; |
76 | 76 |
} |
... | ... | |
102 | 102 |
|
103 | 103 |
public void testInstallPluginFromExternal() throws InstallPackageServiceException, IOException, LocatorException, MakePluginPackageServiceException{ |
104 | 104 |
File applicationDirectory = super.getApplicationDirectory(); |
105 |
File externalInstallationFile = new File(applicationDirectory.getAbsoluteFile() + File.separator + "install" + File.separator + "installer1.zip");
|
|
105 |
File externalInstallationFile = new File(applicationDirectory.getAbsoluteFile() + File.separator + "install" + File.separator + "bundle1.zip");
|
|
106 | 106 |
File pluginsDirectory = super.getPluginsDirectory(); |
107 | 107 |
|
108 | 108 |
InstallPackageService installerExecutionService = |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.impl/src/test/java/org/gvsig/installer/lib/impl/info/InstallerInfoFileReaderTest.java | ||
---|---|---|
50 | 50 |
} |
51 | 51 |
|
52 | 52 |
public void testReadFile() throws LocatorException, InstallerInfoFileException, FileNotFoundException { |
53 |
FileInputStream fis = new FileInputStream(getClass().getClassLoader().getResource("install.info1").getFile());
|
|
53 |
FileInputStream fis = new FileInputStream(getClass().getClassLoader().getResource("package.info1").getFile());
|
|
54 | 54 |
|
55 | 55 |
DefaultPackageInfo installerInfo = new DefaultPackageInfo(); |
56 | 56 |
|
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.impl/src/test/resources/install.info1 | ||
---|---|---|
1 |
code=org.gvsig.myplugin |
|
2 |
name=myplugin |
|
3 |
description=Test |
|
4 |
version=1.0.0 |
|
5 |
build=1 |
|
6 |
state=RC1 |
|
7 |
oficial=true |
|
8 |
type=plugin |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.impl/src/test/resources/bundle1/org.gvsig.plugin1/package.info | ||
---|---|---|
1 |
code=org.gvsig.plugin1 |
|
2 |
name=myplugin |
|
3 |
description=Test |
|
4 |
version=1.0.0 |
|
5 |
build=1 |
|
6 |
state=RC2 |
|
7 |
oficial=true |
|
8 |
type=plugin |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.impl/src/test/resources/bundle1/org.gvsig.plugin2/install.xml | ||
---|---|---|
1 |
<project name="org.gvsig.plugin1" default="main" basedir="."> |
|
2 |
<target name="main" depends="copy_files"/> |
|
3 |
<target name="copy_files"> |
|
4 |
<copy todir="${gvsig_dir}"> |
|
5 |
<fileset dir="./files" includes="**"/> |
|
6 |
</copy> |
|
7 |
</target> |
|
8 |
</project> |
|
0 | 9 |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.impl/src/test/resources/bundle1/org.gvsig.plugin2/package.info | ||
---|---|---|
1 |
code=org.gvsig.plugin2 |
|
2 |
name=myplugin |
|
3 |
description=Test |
|
4 |
version=1.0.0 |
|
5 |
build=1 |
|
6 |
state=RC1 |
|
7 |
oficial=true |
|
8 |
type=plugin |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.impl/src/test/resources/application/gvSIG/extensiones/org.gvsig.wcs/install.info | ||
---|---|---|
1 |
code=org.gvsig.wcs |
|
2 |
name=myplugin |
|
3 |
description=Test |
|
4 |
version=1.0.0 |
|
5 |
build=1 |
|
6 |
state=RC1 |
|
7 |
oficial=true |
|
8 |
type=plugin |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.impl/src/test/resources/application/gvSIG/extensiones/org.gvsig.wcs/package.info | ||
---|---|---|
1 |
code=org.gvsig.wcs |
|
2 |
name=myplugin |
|
3 |
description=Test |
|
4 |
version=1.0.0 |
|
5 |
build=1 |
|
6 |
state=RC1 |
|
7 |
oficial=true |
|
8 |
type=plugin |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.impl/src/test/resources/application/gvSIG/extensiones/org.gvsig.wfs/install.info | ||
---|---|---|
1 |
code=org.gvsig.wfs |
|
2 |
name=myplugin |
|
3 |
description=Test |
|
4 |
version=1.0.0 |
|
5 |
build=1 |
|
6 |
state=RC2 |
|
7 |
oficial=true |
|
8 |
type=plugin |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.impl/src/test/resources/application/gvSIG/extensiones/org.gvsig.wfs/package.info | ||
---|---|---|
1 |
code=org.gvsig.wfs |
|
2 |
name=myplugin |
|
3 |
description=Test |
|
4 |
version=1.0.0 |
|
5 |
build=1 |
|
6 |
state=RC2 |
|
7 |
oficial=true |
|
8 |
type=plugin |
branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.impl/src/test/resources/package.info1 | ||
---|---|---|
1 |
code=org.gvsig.myplugin |
|
2 |
name=myplugin |
|
3 |
description=Test |
|
4 |
version=1.0.0 |
|
5 |
build=1 |
|
6 |
state=RC1 |
|
7 |
oficial=true |
|
8 |
type=plugin |
Also available in: Unified diff