class FileSize implements IStatistic {

  public Map<FileSizeConstants, Long> getFileSizesInByte() {
    EnumMap<FileSizeConstants, Long> fileSizes = new EnumMap<>(FileSizeConstants.class);
    for (FileSizeConstants kinds : MonitorConstants.FileSizeConstants.values()) {

      if (kinds.equals(FileSizeConstants.SYS)) {
        fileSizes.put(kinds, collectSeqFileSize(fileSizes, kinds));
      } else {
        File file = SystemFileFactory.INSTANCE.getFile(kinds.getPath());
        if (file.exists()) {
          try {
            fileSizes.put(kinds, FileUtils.sizeOfDirectory(file));
          } catch (Exception e) {
            logger.error("Meet error while trying to get {} size with dir {} .", kinds,
                kinds.getPath(), e);
            fileSizes.put(kinds, ABNORMAL_VALUE);
          }
        } else {
          fileSizes.put(kinds, INIT_VALUE_IF_FILE_NOT_EXIST);
        }
      }
    }
    return fileSizes;
  }

  private  FileSize();

}