package org.argeo.slc.ui.launch.script;\r
\r
+import java.io.ByteArrayInputStream;\r
import java.io.IOException;\r
-import java.io.StringReader;\r
import java.util.List;\r
import java.util.Properties;\r
import java.util.Vector;\r
import org.argeo.slc.ui.launch.EmbeddedSlcSystem;\r
import org.argeo.slc.ui.launch.SlcSystem;\r
import org.argeo.slc.ui.launch.SlcUiLaunchPlugin;\r
-import org.argeo.slc.ui.launch.preferences.SlcPreferencePage;\r
+import org.argeo.slc.ui.launch.preferences.SlcLaunchPreferencePage;\r
import org.eclipse.core.resources.IFile;\r
import org.eclipse.core.resources.IProject;\r
import org.eclipse.core.resources.ResourcesPlugin;\r
public final static String ANT_MAIN = "org.apache.tools.ant.Main";\r
public final static String SLC_MAIN = "org.argeo.slc.cli.SlcMain";\r
\r
+ @SuppressWarnings("deprecation")\r
public void launch(ILaunchConfiguration configuration, String mode,\r
ILaunch launch, IProgressMonitor monitor) throws CoreException {\r
if (!saveBeforeLaunch(configuration, mode, monitor))\r
if (slcSystem == null) {\r
String slcRuntimePath = SlcUiLaunchPlugin.getDefault()\r
.getPreferenceStore().getString(\r
- SlcPreferencePage.PREF_SLC_RUNTIME_LOCATION);\r
+ SlcLaunchPreferencePage.PREF_SLC_RUNTIME_LOCATION);\r
if (slcRuntimePath == null || slcRuntimePath.equals("")) {\r
showError("SLC Runtime path is not set. Set it in Windows > Preferences > SLC");\r
return null;\r
\r
// Properties\r
Properties properties = new Properties();\r
- StringReader reader = new StringReader(configuration.getAttribute(\r
- SlcScriptUtils.ATTR_PROPERTIES, ""));\r
+ String str = configuration.getAttribute(SlcScriptUtils.ATTR_PROPERTIES,\r
+ "");\r
+ ByteArrayInputStream in = new ByteArrayInputStream(str.getBytes());\r
try {\r
- properties.load(reader);\r
+ properties.load(in);\r
} catch (IOException e) {\r
throw new RuntimeException("Cannot read properties", e);\r
} finally {\r
- if (reader != null)\r
- reader.close();\r
+ if (in != null)\r
+ try {\r
+ in.close();\r
+ } catch (IOException e) {\r
+ // silent\r
+ }\r
}\r
\r
for (Object key : properties.keySet()) {\r