diff options
author | Decebal Suiu <decebal.suiu@gmail.com> | 2019-03-20 23:05:33 +0200 |
---|---|---|
committer | Decebal Suiu <decebal.suiu@gmail.com> | 2019-03-20 23:05:33 +0200 |
commit | f38605432b9ad9d91dbb479dcf08a5f53f0fc285 (patch) | |
tree | e52bef538ecda33009f4dd507620b5ef1e27ef9c /pf4j/src | |
parent | e1fb3f7bc411cdfc3eee0cacedc8f7b1a238b7cd (diff) | |
download | pf4j-f38605432b9ad9d91dbb479dcf08a5f53f0fc285.tar.gz pf4j-f38605432b9ad9d91dbb479dcf08a5f53f0fc285.zip |
Fix warning
Diffstat (limited to 'pf4j/src')
-rw-r--r-- | pf4j/src/main/java/org/pf4j/util/FileUtils.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pf4j/src/main/java/org/pf4j/util/FileUtils.java b/pf4j/src/main/java/org/pf4j/util/FileUtils.java index a3e955e..5c84b2a 100644 --- a/pf4j/src/main/java/org/pf4j/util/FileUtils.java +++ b/pf4j/src/main/java/org/pf4j/util/FileUtils.java @@ -77,7 +77,7 @@ public class FileUtils { * @throws IOException if something goes wrong */ public static void delete(Path path) throws IOException { - Files.walkFileTree(path, new SimpleFileVisitor<Path>() { + Files.walkFileTree(path, new SimpleFileVisitor<>() { @Override public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) throws IOException { @@ -172,7 +172,8 @@ public class FileUtils { FileTime pluginZipDate = Files.getLastModifiedTime(filePath); String fileName = filePath.getFileName().toString(); - Path pluginDirectory = filePath.resolveSibling(fileName.substring(0, fileName.lastIndexOf("."))); + String directoryName = fileName.substring(0, fileName.lastIndexOf(".")); + Path pluginDirectory = filePath.resolveSibling(directoryName); if (!Files.exists(pluginDirectory) || pluginZipDate.compareTo(Files.getLastModifiedTime(pluginDirectory)) > 0) { // do not overwrite an old version, remove it |