com.sun.jna.Native.getTempDir()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(176)

本文整理了Java中com.sun.jna.Native.getTempDir()方法的一些代码示例,展示了Native.getTempDir()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Native.getTempDir()方法的具体详情如下:
包路径:com.sun.jna.Native
类名称:Native
方法名:getTempDir

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")) {

相关文章

Native类方法