Skip to content

Commit

Permalink
Fix dependencies and headers in firmware provider (openhab#782)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdjackson authored Oct 16, 2022
1 parent 8331e04 commit 210ed48
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 55 deletions.
50 changes: 26 additions & 24 deletions feature/pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.zigbee.reactor</artifactId>
<version>3.4.0-SNAPSHOT</version>
<version>3.4.0-SNAPSHOT</version>
</parent>

<groupId>org.openhab.addons.features.karaf</groupId>
Expand Down Expand Up @@ -50,16 +52,16 @@
<artifactId>org.openhab.binding.zigbee.telegesis</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.zigbee.xbee</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.zigbee.firmware</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.zigbee.xbee</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.zigbee.firmware</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.zigbee.serial</artifactId>
Expand Down Expand Up @@ -122,18 +124,18 @@
<aggregateFeatures>true</aggregateFeatures>
<includeTransitiveDependency>false</includeTransitiveDependency>
</configuration>
<executions>
<execution>
<id>create-kar</id>
<goals>
<goal>kar</goal>
</goals>
<configuration>
<resourcesDir>${project.build.directory}/kar</resourcesDir>
<ignoreDependencyFlag>true</ignoreDependencyFlag>
</configuration>
</execution>
</executions>
<executions>
<execution>
<id>create-kar</id>
<goals>
<goal>kar</goal>
</goals>
<configuration>
<resourcesDir>${project.build.directory}/kar</resourcesDir>
<ignoreDependencyFlag>true</ignoreDependencyFlag>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down
2 changes: 1 addition & 1 deletion org.openhab.binding.zigbee.firmware/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.zigbee.reactor</artifactId>
<version>3.3.0-SNAPSHOT</version>
<version>3.4.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.zigbee.firmware</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2010-2021 Contributors to the openHAB project
* Copyright (c) 2010-2022 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
Expand Down Expand Up @@ -60,8 +60,7 @@ protected void activate() {
directoryReader.create("https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master");
directoryReader.updateRemoteDirectory();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
logger.error("Exception activating ZigBee firmware provider ", e);
}
}

Expand Down Expand Up @@ -146,10 +145,6 @@ private Firmware getZigBeeFirmware(@NonNull ThingTypeUID thingTypeUID, Directory
builder.withPrerequisiteVersion(directoryEntry.getPrerequisiteVersion());
}

// BufferedInputStream inputStream = new BufferedInputStream(new URL("").openStream());

// builder.withInputStream(inputStream);

return builder.build();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
/**
* Copyright (c) 2018-2021 by Z-Smart Systems Ltd.
* Copyright (c) 2010-2022 Contributors to the openHAB project
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.zigbee.firmware.internal;

Expand All @@ -13,12 +17,12 @@
import org.openhab.binding.zigbee.handler.ZigBeeFirmwareVersion;

/**
* Contains the information describing a firmware directory entry
*
* @author Chris Jackson
*
*/
public class DirectoryFileEntry {
// private String filename;
private Integer manufacturerCode;
private Integer imageType;
private Integer fileVersion;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
/**
* Copyright (c) 2018-2021 by Z-Smart Systems Ltd.
* Copyright (c) 2010-2022 Contributors to the openHAB project
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.zigbee.firmware.internal;

Expand Down Expand Up @@ -96,7 +100,6 @@ public boolean create(String repositoryAddress) throws Exception {
this.httpClient.setExecutor(executor);

try {
// httpClient.setFollowRedirects(false);
this.httpClient.start();
} catch (Exception e) {
logger.debug("ZigBee Firmware Provider: Cannot start HttpClient for GitHub connection!");
Expand Down Expand Up @@ -219,8 +222,7 @@ public boolean createLocal(DirectoryFileEntry entry) {
try {
createMd5Hash(data, entry);
} catch (NoSuchAlgorithmException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
logger.error("System does not support MD5");

return false;
}
Expand All @@ -234,11 +236,9 @@ public boolean createLocal(DirectoryFileEntry entry) {
outputStream.write(data, 0, data.length);
outputStream.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
logger.error("Can't find file {}", local.getName());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
logger.error("IO Exception writing file {}", local.getName(), e);
}

return true;
Expand All @@ -260,8 +260,7 @@ public InputStream getInputStream(DirectoryFileEntry entry) {
}
return inputStream;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
logger.error("IO Exception reading file {}", local.getName(), e);
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/**
* Copyright (c) 2010-2022 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.zigbee.handler;

import java.util.Objects;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2010-2021 Contributors to the openHAB project
* Copyright (c) 2010-2022 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2010-2021 Contributors to the openHAB project
* Copyright (c) 2010-2022 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2010-2021 Contributors to the openHAB project
* Copyright (c) 2010-2022 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
Expand Down

0 comments on commit 210ed48

Please sign in to comment.