Use PathUtils instead of Paths
@@ -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<Path> stream = Files.newDirectoryStream(Paths.get(getClass().getResource(TIKA_FILES).toURI()))) {
+ try (DirectoryStream<Path> 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);
