ThreeState (@NotNull URL url) { if (url.getProtocol().equals(FILE_PROTOCOL)) { return ThreeState.fromBoolean(urlToFile(url).exists()); } if (url.getProtocol().equals(JAR_PROTOCOL)) { Pair<String, String> paths = splitJarUrl(url.getFile()); if (paths == null) { return ThreeState.NO; } if (!new File(paths.first).isFile()) { return ThreeState.NO; } try { try (ZipFile file = new ZipFile(paths.first)) { return ThreeState.fromBoolean(file.getEntry(paths.second) != null); } } catch (IOException e) { return ThreeState.NO; } } return ThreeState.UNSURE; }