Lines 83-88
Link Here
|
83 |
return BundleInfo.NO_LEVEL; |
83 |
return BundleInfo.NO_LEVEL; |
84 |
} |
84 |
} |
85 |
|
85 |
|
|
|
86 |
private void readExtensionsList(Manipulator manipulator, URI osgiInstallArea, String value) throws NumberFormatException { |
87 |
BundleInfo[] bundles = parseExtensionsList(manipulator, value); |
88 |
if (bundles == null) |
89 |
return; |
90 |
|
91 |
ConfigData configData = manipulator.getConfigData(); |
92 |
for (int i = 0; i < bundles.length; i++) { |
93 |
configData.addExtension(bundles[i]); |
94 |
} |
95 |
} |
96 |
|
97 |
private BundleInfo[] parseExtensionsList(Manipulator manipulator, String value) { |
98 |
if (value == null || value.length() == 0) |
99 |
return null; |
100 |
|
101 |
List bundles = new ArrayList(); |
102 |
String[] bInfoStrings = Utils.getTokens(value, ","); //$NON-NLS-1$ |
103 |
for (int i = 0; i < bInfoStrings.length; i++) { |
104 |
String entry = bInfoStrings[i].trim(); |
105 |
entry = FileUtils.removeEquinoxSpecificProtocols(entry); |
106 |
|
107 |
int indexStartInfo = entry.indexOf('@'); |
108 |
String location = (indexStartInfo == -1) ? entry : entry.substring(0, indexStartInfo); |
109 |
URI realLocation = null; |
110 |
try { |
111 |
if (manipulator.getLauncherData().getFwJar() != null) { |
112 |
realLocation = URIUtil.makeAbsolute(FileUtils.fromFileURL(location), manipulator.getLauncherData().getFwJar().getParentFile().toURI()); |
113 |
} |
114 |
} catch (URISyntaxException e) { |
115 |
Log.log(LogService.LOG_ERROR, "Can't make absolute..."); //$NON-NLS-1$ |
116 |
continue; |
117 |
} |
118 |
|
119 |
if (realLocation != null) { |
120 |
bundles.add(new BundleInfo(realLocation)); |
121 |
continue; |
122 |
} |
123 |
if (location != null && location.startsWith(FILE_PROTOCOL)) |
124 |
try { |
125 |
bundles.add(new BundleInfo(FileUtils.fromFileURL(location))); |
126 |
continue; |
127 |
} catch (URISyntaxException e) { |
128 |
//Ignore |
129 |
} |
130 |
|
131 |
//Fallback case, we use the location as a string |
132 |
bundles.add(new BundleInfo(location, null, null, BundleInfo.NO_LEVEL, false)); |
133 |
} |
134 |
return (BundleInfo[]) bundles.toArray(new BundleInfo[bundles.size()]); |
135 |
} |
136 |
|
137 |
private void writeExtensionsList(File fwJar, Properties props, URI base, BundleInfo[] bundles) { |
138 |
StringBuffer osgiExtensionsList = new StringBuffer(); |
139 |
for (int j = 0; j < bundles.length; j++) { |
140 |
URI location = fwJar != null ? URIUtil.makeRelative(bundles[j].getLocation(), fwJar.getParentFile().toURI()) : bundles[j].getLocation(); |
141 |
osgiExtensionsList.append(toOSGiBundleListForm(bundles[j], location)); |
142 |
if (j < bundles.length - 1) //If it is not the last entry add a comma to separate the entries |
143 |
osgiExtensionsList.append(','); |
144 |
} |
145 |
props.setProperty(EquinoxConstants.PROP_EXTENSIONS, osgiExtensionsList.toString()); |
146 |
} |
147 |
|
86 |
private void readBundlesList(Manipulator manipulator, URI osgiInstallArea, String value) throws NumberFormatException { |
148 |
private void readBundlesList(Manipulator manipulator, URI osgiInstallArea, String value) throws NumberFormatException { |
87 |
BundleInfo[] bundles = parseBundleList(manipulator, value); |
149 |
BundleInfo[] bundles = parseBundleList(manipulator, value); |
88 |
if (bundles == null) |
150 |
if (bundles == null) |
Lines 196-201
Link Here
|
196 |
readp2DataArea(props, configArea); |
258 |
readp2DataArea(props, configArea); |
197 |
readSimpleConfiguratorURL(props, configArea); |
259 |
readSimpleConfiguratorURL(props, configArea); |
198 |
readBundlesList(manipulator, ParserUtils.getOSGiInstallArea(Arrays.asList(launcherData.getProgramArgs()), props, launcherData).toURI(), props.getProperty(EquinoxConstants.PROP_BUNDLES)); |
260 |
readBundlesList(manipulator, ParserUtils.getOSGiInstallArea(Arrays.asList(launcherData.getProgramArgs()), props, launcherData).toURI(), props.getProperty(EquinoxConstants.PROP_BUNDLES)); |
|
|
261 |
readExtensionsList(manipulator, ParserUtils.getOSGiInstallArea(Arrays.asList(launcherData.getProgramArgs()), props, launcherData).toURI(), props.getProperty(EquinoxConstants.PROP_EXTENSIONS)); |
262 |
|
199 |
readInitialStartLeve(configData, props); |
263 |
readInitialStartLeve(configData, props); |
200 |
readDefaultStartLevel(configData, props); |
264 |
readDefaultStartLevel(configData, props); |
201 |
// if (key.equals(EquinoxConstants.PROP_LAUNCHER_NAME)) |
265 |
// if (key.equals(EquinoxConstants.PROP_LAUNCHER_NAME)) |
Lines 427-432
Link Here
|
427 |
writep2DataArea(configData, configProps, configArea); |
491 |
writep2DataArea(configData, configProps, configArea); |
428 |
writeSimpleConfiguratorURL(configData, configProps, configArea); |
492 |
writeSimpleConfiguratorURL(configData, configProps, configArea); |
429 |
writeBundlesList(launcherData.getFwJar(), configProps, ParserUtils.getOSGiInstallArea(Arrays.asList(launcherData.getProgramArgs()), configProps, launcherData).toURI(), bInfos); |
493 |
writeBundlesList(launcherData.getFwJar(), configProps, ParserUtils.getOSGiInstallArea(Arrays.asList(launcherData.getProgramArgs()), configProps, launcherData).toURI(), bInfos); |
|
|
494 |
writeExtensionsList(launcherData.getFwJar(), configProps, ParserUtils.getOSGiInstallArea(Arrays.asList(launcherData.getProgramArgs()), configProps, launcherData).toURI(), bInfos); |
430 |
writeInitialStartLevel(configData, configProps); |
495 |
writeInitialStartLevel(configData, configProps); |
431 |
writeDefaultStartLevel(configData, configProps); |
496 |
writeDefaultStartLevel(configData, configProps); |
432 |
} catch (URISyntaxException e) { |
497 |
} catch (URISyntaxException e) { |