org.codelibs.elasticsearch.idxproxy.util.FileAccessUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elasticsearch-indexing-proxy Show documentation
Show all versions of elasticsearch-indexing-proxy Show documentation
This plugin provides a proxy for indexing.
package org.codelibs.elasticsearch.idxproxy.util;
import java.nio.file.Path;
import java.security.AccessController;
import java.security.PrivilegedAction;
public final class FileAccessUtils {
private FileAccessUtils() {
// nothing
}
public static boolean existsFile(final Path p) {
return AccessController.doPrivileged((PrivilegedAction) () -> {
return p.toFile().exists();
});
}
}