private Path[] listFiles() throws IOException { final Path[] files = FileSystemUtils.files(file); Arrays.sort(files); return files; }
Path[] affixFiles = FileSystemUtils.files(dicDir, "*.aff"); if (affixFiles.length == 0) { throw new ElasticsearchException(String.format(Locale.ROOT, "Missing affix file for hunspell dictionary [%s]", locale)); Path[] dicFiles = FileSystemUtils.files(dicDir, "*.dic"); List<InputStream> dicStreams = new ArrayList<>(dicFiles.length); try {
private Path[] listFiles() throws IOException { final Path[] files = FileSystemUtils.files(file); Arrays.sort(files); return files; }
private Path[] listFiles() throws IOException { final Path[] files = FileSystemUtils.files(file); Arrays.sort(files); return files; }
private Path[] listFiles() throws IOException { final Path[] files = FileSystemUtils.files(file); Arrays.sort(files); return files; }
private Path[] listFiles() throws IOException { final Path[] files = FileSystemUtils.files(file); Arrays.sort(files); return files; }
/** we check whether we need to remove the top-level folder while extracting * sometimes (e.g. github) the downloaded archive contains a top-level folder which needs to be removed */ private Path findPluginRoot(Path dir) throws IOException { if (Files.exists(dir.resolve(PluginInfo.ES_PLUGIN_PROPERTIES))) { return dir; } else { final Path[] topLevelFiles = FileSystemUtils.files(dir); if (topLevelFiles.length == 1 && Files.isDirectory(topLevelFiles[0])) { Path subdir = topLevelFiles[0]; if (Files.exists(subdir.resolve(PluginInfo.ES_PLUGIN_PROPERTIES))) { return subdir; } } } throw new RuntimeException("Could not find plugin descriptor '" + PluginInfo.ES_PLUGIN_PROPERTIES + "' in plugin zip"); }
/** check a candidate plugin for jar hell before installing it */ private void jarHellCheck(Path candidate, boolean isolated) throws IOException { // create list of current jars in classpath final List<URL> jars = new ArrayList<>(); jars.addAll(Arrays.asList(JarHell.parseClassPath())); // read existing bundles. this does some checks on the installation too. List<Bundle> bundles = PluginsService.getPluginBundles(environment.pluginsFile()); // if we aren't isolated, we need to jarhellcheck against any other non-isolated plugins // thats always the first bundle if (isolated == false) { jars.addAll(bundles.get(0).urls); } // add plugin jars to the list Path pluginJars[] = FileSystemUtils.files(candidate, "*.jar"); for (Path jar : pluginJars) { jars.add(jar.toUri().toURL()); } // check combined (current classpath + new jars to-be-added) try { JarHell.checkJarHell(jars.toArray(new URL[jars.size()])); } catch (Exception ex) { throw new RuntimeException(ex); } }
Path[] affixFiles = FileSystemUtils.files(dicDir, "*.aff"); if (affixFiles.length == 0) { throw new ElasticsearchException(String.format(Locale.ROOT, "Missing affix file for hunspell dictionary [%s]", locale)); Path[] dicFiles = FileSystemUtils.files(dicDir, "*.dic"); List<InputStream> dicStreams = new ArrayList<>(dicFiles.length); try {
Path[] affixFiles = FileSystemUtils.files(dicDir, "*.aff"); if (affixFiles.length == 0) { throw new ElasticsearchException(String.format(Locale.ROOT, "Missing affix file for hunspell dictionary [%s]", locale)); Path[] dicFiles = FileSystemUtils.files(dicDir, "*.dic"); List<InputStream> dicStreams = new ArrayList<>(dicFiles.length); try {
Path[] affixFiles = FileSystemUtils.files(dicDir, "*.aff"); if (affixFiles.length == 0) { throw new ElasticsearchException(String.format(Locale.ROOT, "Missing affix file for hunspell dictionary [%s]", locale)); Path[] dicFiles = FileSystemUtils.files(dicDir, "*.dic"); List<InputStream> dicStreams = new ArrayList<>(dicFiles.length); try {
Path[] affixFiles = FileSystemUtils.files(dicDir, "*.aff"); if (affixFiles.length == 0) { throw new ElasticsearchException(String.format(Locale.ROOT, "Missing affix file for hunspell dictionary [%s]", locale)); Path[] dicFiles = FileSystemUtils.files(dicDir, "*.dic"); List<InputStream> dicStreams = new ArrayList<>(dicFiles.length); try {
if (FileSystemUtils.files(targetPath.resolveIndex()).length == 0) { throw new IllegalStateException("index folder [" + targetPath.resolveIndex() + "] is empty"); if (FileSystemUtils.files(targetPath.resolveTranslog()).length == 0) { throw new IllegalStateException("translog folder [" + targetPath.resolveTranslog() + "] is empty");