Browse Source

Fix issue (the plugin directory will be deleted anyway in unzip extract method)

async
Decebal Suiu 6 years ago
parent
commit
dd45a1e6dc
  1. 8
      pf4j/src/main/java/org/pf4j/util/FileUtils.java

8
pf4j/src/main/java/org/pf4j/util/FileUtils.java

@ -176,14 +176,6 @@ public class FileUtils {
Path pluginDirectory = filePath.resolveSibling(directoryName); Path pluginDirectory = filePath.resolveSibling(directoryName);
if (!Files.exists(pluginDirectory) || pluginZipDate.compareTo(Files.getLastModifiedTime(pluginDirectory)) > 0) { if (!Files.exists(pluginDirectory) || pluginZipDate.compareTo(Files.getLastModifiedTime(pluginDirectory)) > 0) {
// do not overwrite an old version, remove it
if (Files.exists(pluginDirectory)) {
FileUtils.delete(pluginDirectory);
}
// create root for plugin
Files.createDirectories(pluginDirectory);
// expand '.zip' file // expand '.zip' file
Unzip unzip = new Unzip(); Unzip unzip = new Unzip();
unzip.setSource(filePath.toFile()); unzip.setSource(filePath.toFile());

Loading…
Cancel
Save