Restore class that is still in use

This commit is contained in:
Mark Vieira 2020-01-28 19:50:49 -08:00
parent 7df3821000
commit 46166b9b40
No known key found for this signature in database
GPG Key ID: CA947EF7E6D4B105
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
package org.elasticsearch.gradle.test;
import com.sun.jna.Native;
import com.sun.jna.WString;
import org.apache.tools.ant.taskdefs.condition.Os;
public class JNAKernel32Library {
private static final class Holder {
private static final JNAKernel32Library instance = new JNAKernel32Library();
}
static JNAKernel32Library getInstance() {
return Holder.instance;
}
private JNAKernel32Library() {
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
Native.register("kernel32");
}
}
native int GetShortPathNameW(WString lpszLongPath, char[] lpszShortPath, int cchBuffer);
}