// TODO: [Optional] Convert path to name in a better way
if (modelPath.lastIndexOf(File.separator) > 0)
{
- modelName = modelPath.substring(modelPath
- .lastIndexOf(File.separator) + 1);
+ modelName = modelPath
+ .substring(modelPath.lastIndexOf(File.separator) + 1);
}
else if (modelPath.lastIndexOf("/") > 0)
{
- modelName = modelPath
- .substring(modelPath.lastIndexOf("/") + 1);
+ modelName = modelPath.substring(modelPath.lastIndexOf("/") + 1);
}
return modelName;
}
public void startListening(String uri)
{
sendChimeraCommand("listen start models url " + uri
- + ";listen start select prefix SelectionChanged url " + uri, false);
+ + ";listen start select prefix SelectionChanged url " + uri,
+ false);
}
/**
{
chimera = null;
currentModelsMap.clear();
- this.chimeraRestPort = 0;
+ this.chimeraRestPort = 0;
structureManager.clearOnChimeraExit();
}
} catch (Exception e)
{
logger.error("Failed to get REST port number from " + responses
- + ": "
- + e.getMessage());
+ + ": " + e.getMessage());
} finally
{
try
*/
public List<String> sendChimeraCommand(String command, boolean reply)
{
-// System.out.println("chimeradebug>> " + command);
+ // System.out.println("chimeradebug>> " + command);
if (!isChimeraLaunched() || command == null
|| "".equals(command.trim()))
{
List<String> reply = new ArrayList<String>();
BufferedReader response = null;
- try {
+ try
+ {
response = HttpClientUtils
.doHttpUrlPost(restUrl, commands, 100, 5000);
String line = "";
- while ((line = response.readLine()) != null) {
+ while ((line = response.readLine()) != null)
+ {
reply.add(line);
}
} catch (Exception e)