code: private void initializeMeta() throws BlockAlreadyExistsException, IOException,
        WorkerOutOfSpaceException {
      // Create the storage directory path
      boolean isDirectoryNewlyCreated = FileUtils.createStorageDirPath(mDirPath,
          ServerConfiguration.get(PropertyKey.WORKER_DATA_FOLDER_PERMISSIONS));
  
      if (isDirectoryNewlyCreated) {
        LOG.info("Folder {} was created!", mDirPath);
      }
  
      File dir = new File(mDirPath);
      File[] paths = dir.listFiles();
      if (paths == null) {
        return;
      }
      for (File path : paths) {
        if (!path.isFile()) {
          LOG.error("{} in StorageDir is not a file", path.getAbsolutePath());
          try {
            // TODO(calvin): Resolve this conflict in class names.
            org.apache.commons.io.FileUtils.deleteDirectory(path);
          } catch (IOException e) {
            LOG.error("can not delete directory {}", path.getAbsolutePath(), e);
          }
        } else {
          try {
            long blockId = Long.parseLong(path.getName());
            addBlockMeta(new BlockMeta(blockId, path.length(), this));
          } catch (NumberFormatException e) {
            LOG.error("filename of {} in StorageDir can not be parsed into long",
                path.getAbsolutePath(), e);
            if (path.delete()) {
              LOG.warn("file {} has been deleted", path.getAbsolutePath());
            } else {
              LOG.error("can not delete file {}", path.getAbsolutePath());
            }
          }
        }
      }
    }
docs: Initializes metadata for existing blocks in this {@link StorageDir}.
  
  Only paths satisfying the contract defined in
  {@link AbstractBlockMeta#commitPath(StorageDir, long)} are legal, should be in format like
  {dir}/{blockId}. other paths will be deleted.
  
  @throws BlockAlreadyExistsException when metadata of existing committed blocks already exists
  @throws WorkerOutOfSpaceException when metadata can not be added due to limited left space