protected void prepareDataDirectory(Injector injector) throws IOException {
    FileConfiguration configuration = injector.getInstance(FileConfiguration.class);
    java.io.File basePath = new java.io.File(configuration.getBasePath());
    deleteDirectory(basePath);
    basePath.mkdir();

    addDisk(injector, 0);
    addDisk(injector, 1);

    for (int disk : injector.getInstance(FileListService.class).getDisks()) {
      java.io.File diskPath = FileUtils.getDiskPathByDisk(configuration, disk);
      for (java.io.File indexFile :
          diskPath.listFiles((FileFilter) new SuffixFileFilter(".data"))) {
        indexFile.delete();
      }
    }

    java.io.File uploadPath = new java.io.File(configuration.getUploadPath());
    if (!uploadPath.exists()) {
      uploadPath.mkdir();
    }
  }
 protected void addDisk(Injector injector, int disk) {
   FileConfiguration configuration = injector.getInstance(FileConfiguration.class);
   java.io.File diskPath = FileUtils.getDiskPathByDisk(configuration, disk);
   diskPath.mkdir();
 }
 protected void removeDisk(Injector injector, int disk) throws IOException {
   FileConfiguration configuration = injector.getInstance(FileConfiguration.class);
   java.io.File diskPath = FileUtils.getDiskPathByDisk(configuration, disk);
   deleteDirectory(diskPath);
 }