code: private static void formatWorkerDataFolder(String folder) throws IOException {
      Path path = Paths.get(folder);
      FileUtils.deletePathRecursively(folder);
      Files.createDirectory(path);
      // For short-circuit read/write to work, others needs to be able to access this directory.
      // Therefore, default is 777 but if the user specifies the permissions, respect those instead.
      String permissions = ServerConfiguration.get(PropertyKey.WORKER_DATA_FOLDER_PERMISSIONS);
      Set<PosixFilePermission> perms = PosixFilePermissions.fromString(permissions);
      Files.setPosixFilePermissions(path, perms);
      FileUtils.setLocalDirStickyBit(path.toAbsolutePath().toString());
    }
docs: Formats the worker data folder.
  
  @param folder folder path