com.thinkaurelius.titan.util.system.IOUtils.deleteDirectory()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(82)

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

IOUtils.deleteDirectory介绍

暂无

代码示例

代码示例来源:origin: thinkaurelius/titan

static public boolean deleteFromDirectory(File path) {
  return deleteDirectory(path, false);
}

代码示例来源:origin: thinkaurelius/titan

static public boolean deleteDirectory(File path, boolean includeDir) {
  boolean success = true;
  if (path.exists()) {
    File[] files = path.listFiles();
    for (int i = 0; i < files.length; i++) {
      if (files[i].isDirectory()) {
        success = deleteDirectory(files[i], true) && success;
      } else {
        success = files[i].delete() && success;
      }
    }
  }
  if (includeDir) success = path.delete() && success;
  return success;
}

代码示例来源:origin: thinkaurelius/titan

/**
   * Test {@link com.thinkaurelius.titan.example.GraphOfTheGodsFactory#create(String)}.
   */
  @Test
  public void testGraphOfTheGodsFactoryCreate() {
    File bdbtmp = new File("target/gotgfactory");
    IOUtils.deleteDirectory(bdbtmp, true);

    TitanGraph gotg = GraphOfTheGodsFactory.create(bdbtmp.getPath());
    TitanIndexTest.assertGraphOfTheGods(gotg);
    gotg.close();
  }
}

代码示例来源:origin: thinkaurelius/titan

@BeforeClass
public static void killElasticsearch() {
  IOUtils.deleteDirectory(new File("es"), true);
  ElasticsearchRunner esr = new ElasticsearchRunner();
  esr.stop();
}

代码示例来源:origin: com.thinkaurelius.titan/titan-core

static public boolean deleteFromDirectory(File path) {
  return deleteDirectory(path, false);
}

代码示例来源:origin: org.hawkular.titan/titan-core

static public boolean deleteFromDirectory(File path) {
  return deleteDirectory(path, false);
}

代码示例来源:origin: org.hawkular.titan/titan-core

static public boolean deleteDirectory(File path, boolean includeDir) {
  boolean success = true;
  if (path.exists()) {
    File[] files = path.listFiles();
    for (int i = 0; i < files.length; i++) {
      if (files[i].isDirectory()) {
        success = deleteDirectory(files[i], true) && success;
      } else {
        success = files[i].delete() && success;
      }
    }
  }
  if (includeDir) success = path.delete() && success;
  return success;
}

代码示例来源:origin: com.thinkaurelius.titan/titan-core

static public boolean deleteDirectory(File path, boolean includeDir) {
  boolean success = true;
  if (path.exists()) {
    File[] files = path.listFiles();
    for (int i = 0; i < files.length; i++) {
      if (files[i].isDirectory()) {
        success = deleteDirectory(files[i], true) && success;
      } else {
        success = files[i].delete() && success;
      }
    }
  }
  if (includeDir) success = path.delete() && success;
  return success;
}

相关文章