Fixing issues in virtual fire alarm

revert-dabc3590
megala21 8 years ago
parent 9fcee2917f
commit 20f8708edb

@ -29,6 +29,7 @@ import org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.transport.
import java.io.*; import java.io.*;
import java.net.URL; import java.net.URL;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.security.PrivateKey; import java.security.PrivateKey;
import java.security.PublicKey; import java.security.PublicKey;
@ -67,15 +68,14 @@ public class AgentUtilOperations {
try { try {
ClassLoader loader = AgentUtilOperations.class.getClassLoader(); ClassLoader loader = AgentUtilOperations.class.getClassLoader();
URL path = loader.getResource(propertiesFileName); URL path = loader.getResource(propertiesFileName);
System.out.println(path); log.info(AgentConstants.LOG_APPENDER + path);
String root = path.getPath().replace( String rootPath = path.getPath().replace("wso2-firealarm-virtual-agent-advanced.jar!/deviceConfig"
"wso2-firealarm-virtual-agent-advanced.jar!/deviceConfig.properties", + ".properties", "").replace("jar:", "").replace("file:", "");
"").replace("jar:", "").replace("file:", "");
rootPath = URLDecoder.decode(rootPath, StandardCharsets.UTF_8.toString());
agentManager.setRootPath(root); agentManager.setRootPath(rootPath);
String deviceConfigFilePath = rootPath + AgentConstants.AGENT_PROPERTIES_FILE_NAME;
propertiesInputStream = new FileInputStream( propertiesInputStream = new FileInputStream(deviceConfigFilePath);
root + AgentConstants.AGENT_PROPERTIES_FILE_NAME);
//load a properties file from class path, inside static method //load a properties file from class path, inside static method
properties.load(propertiesInputStream); properties.load(propertiesInputStream);

@ -1132,7 +1132,7 @@
<carbon.devicemgt.version.range>[2.0.0, 3.0.0)</carbon.devicemgt.version.range> <carbon.devicemgt.version.range>[2.0.0, 3.0.0)</carbon.devicemgt.version.range>
<!-- Carbon App Management --> <!-- Carbon App Management -->
<carbon.appmgt.version>1.2.15</carbon.appmgt.version> <carbon.appmgt.version>1.2.25</carbon.appmgt.version>
<!-- Carbon Device Management Plugins --> <!-- Carbon Device Management Plugins -->
<carbon.devicemgt.plugins.version>3.0.36-SNAPSHOT</carbon.devicemgt.plugins.version> <carbon.devicemgt.plugins.version>3.0.36-SNAPSHOT</carbon.devicemgt.plugins.version>

Loading…
Cancel
Save