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

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

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

IOUtils.deleteFromDirectory介绍

暂无

代码示例

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

public static final void deleteHomeDir(String subdir) {
  File homeDirFile = getHomeDirFile(subdir);
  // Make directory if it doesn't exist
  if (!homeDirFile.exists())
    homeDirFile.mkdirs();
  boolean success = IOUtils.deleteFromDirectory(homeDirFile);
  if (!success) throw new IllegalStateException("Could not remove " + homeDirFile);
}

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

@Override
public void clearStorage() throws BackendException {
  if (!stores.isEmpty())
    throw new IllegalStateException("Cannot delete store, since database is open: " + stores.keySet().toString());
  Transaction tx = null;
  for (String db : environment.getDatabaseNames()) {
    environment.removeDatabase(tx, db);
    log.debug("Removed database {} (clearStorage)", db);
  }
  close();
  IOUtils.deleteFromDirectory(directory);
}

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

public static final void deleteHomeDir(String subdir) {
  File homeDirFile = getHomeDirFile(subdir);
  // Make directory if it doesn't exist
  if (!homeDirFile.exists())
    homeDirFile.mkdirs();
  boolean success = IOUtils.deleteFromDirectory(homeDirFile);
  if (!success) throw new IllegalStateException("Could not remove " + homeDirFile);
}

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

public static final void deleteHomeDir(String subdir) {
  File homeDirFile = getHomeDirFile(subdir);
  // Make directory if it doesn't exist
  if (!homeDirFile.exists())
    homeDirFile.mkdirs();
  boolean success = IOUtils.deleteFromDirectory(homeDirFile);
  if (!success) throw new IllegalStateException("Could not remove " + homeDirFile);
}

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

@Override
public void clearStorage() throws BackendException {
  if (!stores.isEmpty())
    throw new IllegalStateException("Cannot delete store, since database is open: " + stores.keySet().toString());
  Transaction tx = null;
  for (String db : environment.getDatabaseNames()) {
    environment.removeDatabase(tx, db);
    log.debug("Removed database {} (clearStorage)", db);
  }
  close();
  IOUtils.deleteFromDirectory(directory);
}

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

@Override
public void clearStorage() throws StorageException {
  if (!stores.isEmpty())
    throw new IllegalStateException("Cannot delete store, since database is open: " + stores.keySet().toString());
  Transaction tx = null;
  for (String db : environment.getDatabaseNames()) {
    environment.removeDatabase(tx, db);
  }
  close();
  IOUtils.deleteFromDirectory(directory);
}

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

@Override
public void clearStorage() throws StorageException {
  for (String key : stores.keySet()) {
    PersistitKeyValueStore store = stores.remove(key);
    store.clear();
  }
  Volume volume;
  String[] treeNames;
  try {
    volume = db.getVolume(VOLUME_NAME);
    treeNames = volume.getTreeNames();
  } catch (PersistitException ex) {
    throw new PermanentStorageException(ex);
  }
  for (String treeName : treeNames) {
    try {
      Exchange ex = new Exchange(db, volume, treeName, false);
      ex.removeTree();
    } catch (PersistitException ex) {
      throw new PermanentStorageException(ex);
    }
  }
  close();
  IOUtils.deleteFromDirectory(directory);
}

相关文章