diff --git a/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/TikaDocTests.java b/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/TikaDocTests.java index 5535433144e..b4445d16b77 100644 --- a/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/TikaDocTests.java +++ b/plugins/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/TikaDocTests.java @@ -22,12 +22,12 @@ package org.elasticsearch.ingest.attachment; import org.apache.lucene.util.LuceneTestCase.SuppressFileSystems; import org.apache.lucene.util.TestUtil; import org.apache.tika.metadata.Metadata; +import org.elasticsearch.common.io.PathUtils; import org.elasticsearch.test.ESTestCase; import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.Paths; /** * Evil test-coverage cheat, we parse a bunch of docs from tika @@ -43,7 +43,7 @@ public class TikaDocTests extends ESTestCase { public void testFiles() throws Exception { Path tmp = createTempDir(); logger.debug("unzipping all tika sample files"); - try (DirectoryStream stream = Files.newDirectoryStream(Paths.get(getClass().getResource(TIKA_FILES).toURI()))) { + try (DirectoryStream stream = Files.newDirectoryStream(PathUtils.get(getClass().getResource(TIKA_FILES).toURI()))) { for (Path doc : stream) { String filename = doc.getFileName().toString(); TestUtil.unzip(getClass().getResourceAsStream(TIKA_FILES + filename), tmp);