Commit 7ed36fcf authored by Spiros Koulouzis's avatar Spiros Koulouzis

Added prop file for getting jar

parent 798834f3
jar.file.path=/path
\ No newline at end of file
...@@ -21,17 +21,21 @@ import com.rabbitmq.client.DefaultConsumer; ...@@ -21,17 +21,21 @@ import com.rabbitmq.client.DefaultConsumer;
import com.rabbitmq.client.Envelope; import com.rabbitmq.client.Envelope;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.File; import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.FileReader; import java.io.FileReader;
import java.io.FileWriter; import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Properties;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import nl.uva.sne.drip.commons.types.Parameter; import nl.uva.sne.drip.commons.types.Parameter;
...@@ -45,12 +49,13 @@ import org.json.JSONObject; ...@@ -45,12 +49,13 @@ import org.json.JSONObject;
* This is an example of a Message consumer * This is an example of a Message consumer
* *
* *
* @author H. Zhou * @author H. Zhou, S. Koulouzis
*/ */
public class Consumer extends DefaultConsumer { public class Consumer extends DefaultConsumer {
private final Channel channel; private final Channel channel;
private final String jarFilePath = "/root/SWITCH/bin/ProvisioningCore.jar"; private final String propertiesPath = "etc/consumer.properties";
private String jarFilePath;
public class topologyElement { public class topologyElement {
...@@ -58,9 +63,15 @@ public class Consumer extends DefaultConsumer { ...@@ -58,9 +63,15 @@ public class Consumer extends DefaultConsumer {
String outputFilePath = ""; String outputFilePath = "";
} }
public Consumer(Channel channel) { public Consumer(Channel channel) throws IOException {
super(channel); super(channel);
this.channel = channel; this.channel = channel;
Properties prop = new Properties();
try (InputStream in = new FileInputStream(propertiesPath)) {
prop.load(in);
}
jarFilePath = prop.getProperty("jar.file.path", "/root/SWITCH/bin/ProvisioningCore.jar");
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment