class DirectoryStrategy {

  public void setFolders(List<String> folders) throws DiskSpaceInsufficientException {
    boolean hasSpace = false;
    for (String folder : folders) {
      if (CommonUtils.hasSpace(folder)) {
        hasSpace = true;
        break;
      }
    }
    if (!hasSpace) {
      IoTDBDescriptor.getInstance().getConfig().setReadOnly(true);
      throw new DiskSpaceInsufficientException(folders);
    }

    this.folders = folders;
  }

}