- Path tempJar = null;
- if (locator instanceof Path && Files.isDirectory((Path) locator))
- tempJar = toTempJar((Path) locator);
- try (InputStream in = newInputStream(tempJar != null ? tempJar : locator)) {
+ Path locatorPath = (Path) locator;
+ Path pathToUse;
+ boolean isTemp = false;
+ if (locator instanceof Path && Files.isDirectory(locatorPath)) {
+ pathToUse = toTempJar(locatorPath);
+ isTemp = true;
+ } else {
+ pathToUse = locatorPath;
+ }
+ try (InputStream in = newInputStream(pathToUse)) {