36 |
36 |
import java.net.URL;
|
37 |
37 |
import java.util.Properties;
|
38 |
38 |
|
|
39 |
import org.slf4j.Logger;
|
|
40 |
import org.slf4j.LoggerFactory;
|
|
41 |
|
39 |
42 |
import org.gvsig.installer.lib.api.PackageInfo;
|
40 |
43 |
import org.gvsig.installer.lib.spi.InstallerInfoFileException;
|
41 |
44 |
|
... | ... | |
44 |
47 |
*/
|
45 |
48 |
public class InstallerInfoFileReader {
|
46 |
49 |
|
|
50 |
private static final Logger LOG = LoggerFactory
|
|
51 |
.getLogger(InstallerInfoFileReader.class);
|
|
52 |
|
47 |
53 |
/**
|
48 |
54 |
* Reads and parses the install.info file and creates one object that
|
49 |
55 |
* contains the information.
|
... | ... | |
115 |
121 |
installerInfoResource.setBuild(Integer.parseInt(build));
|
116 |
122 |
} catch (Exception e) {
|
117 |
123 |
installerInfoResource.setBuild(0);
|
|
124 |
LOG.warn("Error while converting to int the "
|
|
125 |
+ InstallerInfoTags.BUILD + " property value: " + build, e);
|
118 |
126 |
}
|
|
127 |
|
|
128 |
// Look for the old build tag just in case (the new one is buildNumber).
|
|
129 |
if (installerInfoResource.getBuild() <= 0) {
|
|
130 |
String oldBuild =
|
|
131 |
properties.getProperty(InstallerInfoTags.BUILD_OLD);
|
|
132 |
if (oldBuild != null) {
|
|
133 |
try {
|
|
134 |
installerInfoResource.setBuild(Integer
|
|
135 |
.parseInt(oldBuild));
|
|
136 |
} catch (Exception e) {
|
|
137 |
installerInfoResource.setBuild(0);
|
|
138 |
LOG.warn("Error while converting to int the "
|
|
139 |
+ InstallerInfoTags.BUILD_OLD + " property value: "
|
|
140 |
+ oldBuild, e);
|
|
141 |
}
|
|
142 |
}
|
|
143 |
}
|
119 |
144 |
installerInfoResource.setState(properties
|
120 |
145 |
.getProperty(InstallerInfoTags.STATE));
|
121 |
|
try {
|
122 |
|
installerInfoResource.setOfficial(Boolean.parseBoolean(properties
|
123 |
|
.getProperty(InstallerInfoTags.OFFICIAL)));
|
124 |
|
} catch (Exception e) {
|
125 |
|
installerInfoResource.setOfficial(false);
|
126 |
|
}
|
|
146 |
try {
|
|
147 |
installerInfoResource.setOfficial(Boolean.parseBoolean(properties
|
|
148 |
.getProperty(InstallerInfoTags.OFFICIAL)));
|
|
149 |
} catch (Exception e) {
|
|
150 |
installerInfoResource.setOfficial(false);
|
|
151 |
LOG.warn(
|
|
152 |
"Error while converting to boolean the "
|
|
153 |
+ InstallerInfoTags.OFFICIAL + " property value: "
|
|
154 |
+ properties.getProperty(InstallerInfoTags.OFFICIAL), e);
|
|
155 |
}
|
127 |
156 |
|
128 |
157 |
String os = properties.getProperty(InstallerInfoTags.OS);
|
129 |
158 |
if (os != null) {
|