<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-update-center-common</artifactId>
</dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>sonar-home</artifactId>
- </dependency>
<!-- logging -->
<dependency>
package org.sonar.core.platform;
import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang.StringUtils;
-import org.sonar.home.cache.FileHashes;
public class RemotePlugin {
private String pluginKey;
}
public RemotePlugin setFile(File f) {
- return this.setFile(f.getName(), new FileHashes().of(f));
+ try (FileInputStream fis = new FileInputStream(f)) {
+ return this.setFile(f.getName(), DigestUtils.md5Hex(fis));
+ } catch (IOException e) {
+ throw new IllegalStateException("Fail to compute hash", e);
+ }
}
public RemotePluginFile file() {