|
|
@ -304,8 +304,8 @@ public class VirtualFireAlarmService {
|
|
|
|
public Response downloadSketch(@QueryParam("owner") String owner,
|
|
|
|
public Response downloadSketch(@QueryParam("owner") String owner,
|
|
|
|
@QueryParam("deviceName") String customDeviceName,
|
|
|
|
@QueryParam("deviceName") String customDeviceName,
|
|
|
|
@PathParam("sketch_type") String sketchType) {
|
|
|
|
@PathParam("sketch_type") String sketchType) {
|
|
|
|
|
|
|
|
//TODO:: null check customDeviceName at UI level
|
|
|
|
ZipArchive zipFile = null;
|
|
|
|
ZipArchive zipFile = null;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
zipFile = createDownloadFile(owner, customDeviceName, sketchType);
|
|
|
|
zipFile = createDownloadFile(owner, customDeviceName, sketchType);
|
|
|
|
Response.ResponseBuilder rb = Response.ok(zipFile.getZipFile());
|
|
|
|
Response.ResponseBuilder rb = Response.ok(zipFile.getZipFile());
|
|
|
@ -391,8 +391,7 @@ public class VirtualFireAlarmService {
|
|
|
|
//Register the device with CDMF
|
|
|
|
//Register the device with CDMF
|
|
|
|
String deviceName = customDeviceName + "_" + deviceId;
|
|
|
|
String deviceName = customDeviceName + "_" + deviceId;
|
|
|
|
status = register(deviceId, deviceName, owner);
|
|
|
|
status = register(deviceId, deviceName, owner);
|
|
|
|
// status = register(deviceId, owner + "s_" + sketchType + "_" + deviceId.substring(0, 3),
|
|
|
|
|
|
|
|
// owner);
|
|
|
|
|
|
|
|
if (!status) {
|
|
|
|
if (!status) {
|
|
|
|
String msg = "Error occurred while registering the device with " + "id: " + deviceId
|
|
|
|
String msg = "Error occurred while registering the device with " + "id: " + deviceId
|
|
|
|
+ " owner:" + owner;
|
|
|
|
+ " owner:" + owner;
|
|
|
|