本文整理了Java中com.sun.jna.Native.getTempDir()
方法的一些代码示例,展示了Native.getTempDir()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Native.getTempDir()
方法的具体详情如下:
包路径:com.sun.jna.Native
类名称:Native
方法名:getTempDir
[英]Obtain a directory suitable for writing JNA-specific temporary files. Override with jna.tmpdir
[中]获取适合写入JNA特定临时文件的目录。用jna.tmpdir
覆盖
代码示例来源:origin: net.java.dev.jna/jna
/** Remove all marked temporary files in the given directory. */
static void removeTemporaryFiles() throws IOException {
File dir = getTempDir();
FilenameFilter filter = new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
return name.endsWith(".x") && name.startsWith(JNA_TMPLIB_PREFIX);
}
};
File[] files = dir.listFiles(filter);
for (int i=0;files != null && i < files.length;i++) {
File marker = files[i];
String name = marker.getName();
name = name.substring(0, name.length()-2);
File target = new File(marker.getParentFile(), name);
if (!target.exists() || target.delete()) {
marker.delete();
}
}
}
代码示例来源:origin: net.java.dev.jna/jna
File dir = getTempDir();
lib = File.createTempFile(JNA_TMPLIB_PREFIX, Platform.isWindows()?".dll":null, dir);
if (!Boolean.getBoolean("jnidispatch.preserve")) {
代码示例来源:origin: org.elasticsearch/jna
/** Remove all marked temporary files in the given directory. */
static void removeTemporaryFiles() throws IOException {
File dir = getTempDir();
FilenameFilter filter = new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
return name.endsWith(".x") && name.startsWith(JNA_TMPLIB_PREFIX);
}
};
File[] files = dir.listFiles(filter);
for (int i=0;files != null && i < files.length;i++) {
File marker = files[i];
String name = marker.getName();
name = name.substring(0, name.length()-2);
File target = new File(marker.getParentFile(), name);
if (!target.exists() || target.delete()) {
marker.delete();
}
}
}
代码示例来源:origin: org.elasticsearch/jna
File dir = getTempDir();
lib = File.createTempFile(JNA_TMPLIB_PREFIX, Platform.isWindows()?".dll":null, dir);
if (!Boolean.getBoolean("jnidispatch.preserve")) {
内容来源于网络,如有侵权,请联系作者删除!